diff options
author | Michael Scherle | 2022-08-04 16:40:28 +0200 |
---|---|---|
committer | Simon Rettberg | 2024-05-13 18:25:14 +0200 |
commit | 300dbe37c5499c98189aad2ab4591840fd5c279c (patch) | |
tree | 1078c1c202faafbde360f3e0b334e6a580d02860 /src | |
parent | [FUSE] basic cow implementation & rudimentary tests (diff) | |
download | dnbd3-300dbe37c5499c98189aad2ab4591840fd5c279c.tar.gz dnbd3-300dbe37c5499c98189aad2ab4591840fd5c279c.tar.xz dnbd3-300dbe37c5499c98189aad2ab4591840fd5c279c.zip |
added github ci for fuse with cow
Diffstat (limited to 'src')
-rw-r--r-- | src/fuse/cowDoc/readme.md | 2 | ||||
-rw-r--r-- | src/fuse/cowfile.c | 21 |
2 files changed, 17 insertions, 6 deletions
diff --git a/src/fuse/cowDoc/readme.md b/src/fuse/cowDoc/readme.md index 9ad7fa2..27b6bc6 100644 --- a/src/fuse/cowDoc/readme.md +++ b/src/fuse/cowDoc/readme.md @@ -24,7 +24,7 @@ A typical use case is updating or adding software to an existing image. - `- L <path>` Similar to `-c <path>`, but instead of creating a new session, an existing one is loaded from the specified path. - `-m` the client requests a merge after the image has been unmounted and all changes have been uploaded. -- `cowStatFile` creates a status file at the same location as the data and meta file. The file contains information about the current session, for more information see [here](#status). +- `--cowStatFile` creates a status file at the same location as the data and meta file. The file contains information about the current session, for more information see [here](#status). - `--cowStatStdout` similar to `--cowStatFile` but the information will be printed in the stdout. Example parameters for creating a new cow session: diff --git a/src/fuse/cowfile.c b/src/fuse/cowfile.c index 965e6f4..f627f88 100644 --- a/src/fuse/cowfile.c +++ b/src/fuse/cowfile.c @@ -819,9 +819,15 @@ bool cowfile_init( char *path, const char *image_Name, uint16_t imageVersion, at } createCowStatsFile( path ); - pthread_create( &tidCowUploader, NULL, &cowfile_uploader, NULL ); + if( pthread_create( &tidCowUploader, NULL, &cowfile_uploader, NULL ) != 0 ) { + logadd( LOG_ERROR, "Could not create cow uploader thread"); + return false; + } if ( statFile || statStdout ) { - pthread_create( &tidStatUpdater, NULL, &cowfile_statUpdater, NULL ); + if(pthread_create( &tidStatUpdater, NULL, &cowfile_statUpdater, NULL ) != 0 ){ + logadd( LOG_ERROR, "Could not create stat updater thread"); + return false; + } } return true; } @@ -929,10 +935,15 @@ bool cowfile_load( char *path, atomic_uint_fast64_t **imageSizePtr, char *server cow.firstL2 = (l2 *)( ( (char *)cow.l1 ) + cow.l1Size ); pthread_mutex_init( &cow.l2CreateLock, NULL ); createCowStatsFile( path ); - pthread_create( &tidCowUploader, NULL, &cowfile_uploader, NULL ); - + if( pthread_create( &tidCowUploader, NULL, &cowfile_uploader, NULL ) != 0 ) { + logadd( LOG_ERROR, "Could not create cow uploader thread"); + return false; + } if ( statFile || statStdout ) { - pthread_create( &tidStatUpdater, NULL, &cowfile_statUpdater, NULL ); + if(pthread_create( &tidStatUpdater, NULL, &cowfile_statUpdater, NULL ) != 0 ){ + logadd( LOG_ERROR, "Could not create stat updater thread"); + return false; + } } return true; |