Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/include
In directory usw-pr-cvs1:/tmp/cvs-serv4422
Modified Files:
ntfsd.h
Log Message:
Final ntfsd.h (I hope).
Index: ntfsd.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/ntfsd.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -U2 -r1.2 -r1.3
--- ntfsd.h 2001/04/07 00:45:49 1.2
+++ ntfsd.h 2001/04/07 13:47:55 1.3
@@ -28,10 +28,10 @@
/*
- * We use a set of atomic flags for locking/control. No need of any
- * locking due to atomicity of operations.
+ * We use a set of atomic flags for locking / access serialization. No need of
+ * any additional locking (using spinlocks/semaphores/whatever) due to
+ * atomicity of operations.
*/
+extern unsigned int ntfsd_flags;
-unsigned int ntfsd_flags = 0;
-
/* Ntfsd flags bit values */
#define NTFSD_running 0
@@ -51,4 +51,59 @@
#define SetNtfsdStarted(a) set_bit(NTFSD_started, &(a))
#define ClearNtfsdStarted(a) clear_bit(NTFSD_started, &(a))
+
+/**
+ * ntfsd_start - start the writer daemon/thread
+ *
+ * Start the writer deamon / thread. Currently implemented using an interval
+ * timer and a handler for the SIGALRM signal.
+ *
+ * Return TRUE on success or FALSE on error. In the latter case, errno contains
+ * the error code.
+ *
+ * Important error codes:
+ * ECANCELED - The signal handler was set but the timer setting failed.
+ * Tried resetting the signal handler but this failed. So,
+ * ntfsd will handle SIGALRM should it occur, but it won't do
+ * anything as it is not started.
+ * EBUSY - Ntfsd is busy in a previous call to ntfsd_start/ntfsd_stop.
+ * Try calling again later.
+ * EINTR - One of the system calls was interrupted more than three times
+ * in a row. You could try again.
+ * ENOTSUP - The host system does not support SIGALRM signal. )-:
+ * EFAULT - Internal error. This is BAD.
+ * others - Other error codes returned by one of the system calls.
+ */
+int ntfsd_start(void);
+
+/**
+ * ntfsd_stop - stop the writer daemon/thread
+ *
+ * Stop the writer deamon / thread. Currently implemented using an interval
+ * timer and a handler for the SIGALRM signal.
+ *
+ * Return TRUE on success or FALSE on error. In the latter case, errno contains
+ * the error code.
+ *
+ * On error, ntfsd remains active, unless errno is ECANCELED, in which case
+ * ntfsd has been stopped (and the timer has been stopped, so no periodic
+ * SIGALRM signals will be generated), but ntfsd is still registered as the
+ * SIGALRM handler (since uninstallation failed), so the code has to remain
+ * loaded in memory. In theory this will never occur but better catch the
+ * impossible before practise makes the the theoretically impossible possible.
+ *
+ * Important error codes:
+ * ECANCELED - The timer was stopped but the signal handler could not be
+ * reset. Tried restarting the timer but this failed. So,
+ * ntfsd will handle SIGALRM should it occur, but it won't do
+ * anything as it is not started any more.
+ * EBUSY - Ntfsd is busy in a previous call to ntfsd_start/ntfsd_stop.
+ * Try calling again later.
+ * EINTR - One of the system calls was interrupted more than three times
+ * in a row. You could try again.
+ * ENOTSUP - The host system does not support SIGALRM signal. )-:
+ * EFAULT - Internal error. This is BAD.
+ * others - Other error codes returned by one of the system calls.
+ */
+int ntfsd_stop(void);
#endif /* defined NTFSD_H */
|