]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - server.c
Kill mmd_lock() and mmd_unlock().
[paraslash.git] / server.c
index 244c1ecd25da7959cf3ce6b9dcff3d9e814b2ad0..5ea8811f960550c26d9b99a2c0a15b9ac204f7f7 100644 (file)
--- a/server.c
+++ b/server.c
@@ -107,15 +107,18 @@ struct server_args_info conf;
 /** A random value used in child context for authentication. */
 uint32_t afs_socket_cookie;
 
+/** The mutex protecting the shared memory area containing the mmd struct. */
+int mmd_mutex;
+
 /* global variables for server-internal use */
 static FILE *logfile;
 /** The file containing user information (public key, permissions). */
 static char *user_list_file = NULL;
-static int mmd_mutex, mmd_shm_id;
+static int mmd_shm_id;
 static pid_t afs_pid;
 
 
-/** The task resposible for server command handling. */
+/** The task responsible for server command handling. */
 struct server_command_task {
        /** TCP port on which para_server listens for connections. */
        int listen_fd;
@@ -194,27 +197,6 @@ err_out:
        exit(EXIT_FAILURE);
 }
 
-/**
- * Lock the shared memory area containing the mmd struct.
- *
- * \sa semop(2), struct misc_meta_data.
- */
-void mmd_lock(void)
-{
-       mutex_lock(mmd_mutex);
-}
-
-/**
- * Unlock the shared memory area containing the mmd struct.
- *
- * \sa semop(2), struct misc_meta_data.
- */
-
-void mmd_unlock(void)
-{
-       mutex_unlock(mmd_mutex);
-}
-
 static void parse_config(int override)
 {
        char *home = para_homedir();
@@ -552,9 +534,9 @@ static int server_select(int max_fileno, fd_set *readfds, fd_set *writefds,
        int ret;
 
        status_refresh();
-       mmd_unlock();
+       mutex_unlock(mmd_mutex);
        ret = para_select(max_fileno + 1, readfds, writefds, timeout_tv);
-       mmd_lock();
+       mutex_lock(mmd_mutex);
        return ret;
 }
 
@@ -577,7 +559,7 @@ int main(int argc, char *argv[])
                .select_function = server_select
        };
        server_init(argc, argv);
-       mmd_lock();
+       mutex_lock(mmd_mutex);
        ret = schedule(&s);
        if (ret < 0) {
                PARA_EMERG_LOG("%s\n", para_strerror(-ret));