Check-in [39025b67ed]
Overview
Comment:Removed interruption support, there is no clean way to implement it
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:39025b67ed47e421204cbec8e43352992a4ce139
User & Date: rkeene on 2014-11-12 05:09:40
Other Links: manifest | tags
Context
2014-11-12
05:46
Fixed actual problem with interruptions (which was really unrelated) -- Tcl notifier thread is terminated on fork() called by fuse_main(), since we create a Tcl interpreter for testing before calling fuse_main() the notifier dies and is not restarted. We now terminate it before fork(). check-in: 0819a7a89c user: rkeene tags: trunk
05:09
Removed interruption support, there is no clean way to implement it check-in: 39025b67ed user: rkeene tags: trunk
2014-11-11
19:10
Added SIGUSR1 handling for terminating a thread check-in: 6eb9af02d5 user: rkeene tags: trunk
Changes

Modified appfsd.c from [843bfcfd7e] to [30750361ba].

1466
1467
1468
1469
1470
1471
1472


1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
....
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
}

/*
 * Hot-restart support
 */
/* Initiate a hot-restart */
static void appfs_hot_restart(void) {


	appfs_tcl_ResetInterps();
	appfs_get_path_info_cache_flush(-1, -1);

	return;
}

/*
 * Terminate a thread and release resources
 */
static void appfs_thread_exit(void) {
	Tcl_Interp *interp;

	pthread_exit(NULL);

	interp = pthread_getspecific(interpKey);
	if (interp != NULL) {
		Tcl_DeleteInterp(interp);
	}

	return;
}

/*
 * Signal handler
 *         SIGHUP initiates a hot restart
 *         SIGUSR1 terminates the current thread
 */
static void appfs_signal_handler(int sig) {
	/* Do not handle signals until FUSE has been started */
	if (!appfs_fuse_started) {
		return;
	}

	/* Request to perform a "hot" restart */
	if (sig == SIGHUP) {
		appfs_hot_restart();
	}

	/* Request to terminate the current request/thread */
	if (sig == SIGUSR1) {
		appfs_thread_exit();
	}

	return;
}

/*
 * FUSE operations structure
 */
static struct fuse_operations appfs_operations = {
................................................................................
		fprintf(stderr, "Hot-restart will not be available.\n");
	}

	/*
	 * Add FUSE arguments which we always supply
	 */
	fuse_opt_parse(&args, NULL, NULL, appfs_fuse_opt_cb);
	fuse_opt_add_arg(&args, "-odefault_permissions,fsname=appfs,subtype=appfsd,use_ino,kernel_cache,entry_timeout=0,attr_timeout=0,intr,big_writes,hard_remove");

	if (getuid() == 0) {
		fuse_opt_parse(&args, NULL, NULL, NULL);
		fuse_opt_add_arg(&args, "-oallow_other");
	}

	/*







>
>






<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<



<












<
<
<
<
<







 







|







1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
















1481
1482
1483

1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495





1496
1497
1498
1499
1500
1501
1502
....
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
}

/*
 * Hot-restart support
 */
/* Initiate a hot-restart */
static void appfs_hot_restart(void) {
	APPFS_DEBUG("Asked to initiate hot restart");

	appfs_tcl_ResetInterps();
	appfs_get_path_info_cache_flush(-1, -1);

	return;
}

















/*
 * Signal handler
 *         SIGHUP initiates a hot restart

 */
static void appfs_signal_handler(int sig) {
	/* Do not handle signals until FUSE has been started */
	if (!appfs_fuse_started) {
		return;
	}

	/* Request to perform a "hot" restart */
	if (sig == SIGHUP) {
		appfs_hot_restart();
	}






	return;
}

/*
 * FUSE operations structure
 */
static struct fuse_operations appfs_operations = {
................................................................................
		fprintf(stderr, "Hot-restart will not be available.\n");
	}

	/*
	 * Add FUSE arguments which we always supply
	 */
	fuse_opt_parse(&args, NULL, NULL, appfs_fuse_opt_cb);
	fuse_opt_add_arg(&args, "-odefault_permissions,fsname=appfs,subtype=appfsd,use_ino,kernel_cache,entry_timeout=0,attr_timeout=0,big_writes,hard_remove");

	if (getuid() == 0) {
		fuse_opt_parse(&args, NULL, NULL, NULL);
		fuse_opt_add_arg(&args, "-oallow_other");
	}

	/*