Beispiel #1
0
// end a functional test
int fskit_test_end( struct fskit_core* core, void** test_data ) {

   int rc = 0;

   rc = fskit_detach_all( core, "/", core->root.children );
   if( rc != 0 ) {
      fskit_error("fskit_detach_all(\"/\") rc = %d\n", rc );
      return rc;
   }

   rc = fskit_core_destroy( core, test_data );
   if( rc != 0 ) {
      fskit_error("fskit_core_destroy rc = %d\n", rc );
      return rc;
   }

   rc = fskit_library_shutdown();
   if( rc != 0 ) {
      return rc;
   }

   return rc;
}
Beispiel #2
0
// shut down fskit fuse
int fskit_fuse_shutdown( struct fskit_fuse_state* state, void** core_state ) {

   struct fskit_core* core = state->core;
   int rc = 0;

   if( core != NULL ) {
       // clean up
       // blow away all inodes
       rc = fskit_detach_all( core, "/" );
       if( rc != 0 ) {
          fskit_error( "fskit_detach_all(\"/\") rc = %d\n", rc );
       }

       // destroy the core
       rc = fskit_core_destroy( core, core_state );
       if( rc != 0 ) {
          fskit_error( "fskit_core_destroy rc = %d\n", rc );
       }

       // shut down the library
       rc = fskit_library_shutdown();
       if( rc != 0 ) {
          fskit_error( "fskit_library_shutdown rc = %d\n", rc );
       }

       free( core );
       state->core = NULL;
   }

   // free mountpoint
   if( state->mountpoint != NULL ) {
      free( state->mountpoint );
      state->mountpoint = NULL;
   }

   return rc;
}