]> arthur.barton.de Git - netatalk.git/commitdiff
Rename ad_private.h to ad_lock.h
authorFrank Lahm <franklahm@googlemail.com>
Fri, 17 Dec 2010 11:22:07 +0000 (12:22 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Fri, 17 Dec 2010 11:22:07 +0000 (12:22 +0100)
libatalk/adouble/Makefile.am
libatalk/adouble/ad_lock.c
libatalk/adouble/ad_lock.h [new file with mode: 0644]
libatalk/adouble/ad_mmap.c
libatalk/adouble/ad_open.c
libatalk/adouble/ad_private.h [deleted file]
libatalk/adouble/ad_sendfile.c

index 8a242c2a87679e775aa3773c3d335f02ad6d49f6..6602926b6328986453cb395bbb9c476bdf582aca 100644 (file)
@@ -5,4 +5,4 @@ noinst_LTLIBRARIES = libadouble.la
 libadouble_la_SOURCES = ad_open.c ad_flush.c ad_read.c ad_write.c ad_size.c \
        ad_mmap.c ad_lock.c ad_date.c ad_attr.c ad_sendfile.c
 
-noinst_HEADERS = ad_private.h
+noinst_HEADERS = ad_lock.h
index 688ec4b9624ea439dbcc2a14ea1b08f787f161fd..e31133cb90509daa1caf3a0f891a4dffb5dd4dda 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <string.h>
 
-#include "ad_private.h"
+#include "ad_lock.h"
 
 /* translate between ADLOCK styles and specific locking mechanisms */
 #define XLATE_FLOCK(type) ((type) == ADLOCK_RD ? LOCK_SH : \
diff --git a/libatalk/adouble/ad_lock.h b/libatalk/adouble/ad_lock.h
new file mode 100644 (file)
index 0000000..490bff2
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef LIBATALK_ADOUBLE_AD_PRIVATE_H
+#define LIBATALK_ADOUBLE_AD_PRIVATE_H 1
+
+#include <atalk/adouble.h>
+
+/* this is so that we can keep lists of fds referencing the same file
+ * around. that way, we can honor locks created by the same process
+ * with the same file. */
+
+#define adf_lock_init(a)                            \
+    do {                                            \
+        (a)->adf_lockmax = (a)->adf_lockcount = 0;  \
+        (a)->adf_excl = 0;(a)->adf_lock = NULL;     \
+    } while (0)
+
+#define adf_lock_free(a)                                      \
+    do {                                                      \
+        int i;                                                \
+        if ((a)->adf_lock != NULL) {                          \
+            for (i = 0; i < (a)->adf_lockcount; i++) {        \
+                adf_lock_t *lock = (a)->adf_lock + i;         \
+                if (--(*lock->refcount) < 1)                  \
+                    free(lock->refcount);                     \
+            }                                                 \
+            free((a)->adf_lock);                              \
+            adf_lock_init(a);                                 \
+        }                                                     \
+    } while (0)
+
+#endif /* libatalk/adouble/ad_private.h */
index 2cb5c05937f2f6d69470996bea5994eaaf069e2b..a93ab5a502dfa64a7f826160457b4fa61d93b304 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: ad_mmap.c,v 1.6 2008-12-03 18:35:44 didg Exp $
- *
  * ad_mmap provides interfaces to memory mapped files. as this is the
  * case, we don't have to deal w/ temporary buffers such as
  * ad_data. the ad_mmap routines are designed to not interact w/ the
@@ -17,7 +15,7 @@
 #include <atalk/adouble.h>
 #include <string.h>
 
-#include "ad_private.h"
+#include "ad_lock.h"
 
 static void *ad_mmap(const size_t length, const int prot,
                                const int flags, const int fd, 
index ee33a4ad40eb6c5bf40694d2668b93f41a217af4..fc6e27c8dd025447ea29824161bd84e65e73cc55 100644 (file)
@@ -49,7 +49,7 @@
 #include <atalk/bstrlib.h>
 #include <atalk/bstradd.h>
 
-#include "ad_private.h"
+#include "ad_lock.h"
 
 #ifndef MAX
 #define MAX(a, b)  ((a) < (b) ? (b) : (a))
diff --git a/libatalk/adouble/ad_private.h b/libatalk/adouble/ad_private.h
deleted file mode 100644 (file)
index 490bff2..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef LIBATALK_ADOUBLE_AD_PRIVATE_H
-#define LIBATALK_ADOUBLE_AD_PRIVATE_H 1
-
-#include <atalk/adouble.h>
-
-/* this is so that we can keep lists of fds referencing the same file
- * around. that way, we can honor locks created by the same process
- * with the same file. */
-
-#define adf_lock_init(a)                            \
-    do {                                            \
-        (a)->adf_lockmax = (a)->adf_lockcount = 0;  \
-        (a)->adf_excl = 0;(a)->adf_lock = NULL;     \
-    } while (0)
-
-#define adf_lock_free(a)                                      \
-    do {                                                      \
-        int i;                                                \
-        if ((a)->adf_lock != NULL) {                          \
-            for (i = 0; i < (a)->adf_lockcount; i++) {        \
-                adf_lock_t *lock = (a)->adf_lock + i;         \
-                if (--(*lock->refcount) < 1)                  \
-                    free(lock->refcount);                     \
-            }                                                 \
-            free((a)->adf_lock);                              \
-            adf_lock_init(a);                                 \
-        }                                                     \
-    } while (0)
-
-#endif /* libatalk/adouble/ad_private.h */
index 2cc9a1f4470f8e75fe7b35b3fd1b6da52f6aec23..2a1f1426aa45b6a5aeb1aa13614c46b3be17e078 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: ad_sendfile.c,v 1.11 2010-01-21 14:14:49 didg Exp $
- *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  *
 #endif /* HAVE_CONFIG_H */
 
 #ifdef WITH_SENDFILE
-
-#include <atalk/adouble.h>
-
 #include <stdio.h>
-
 #include <sys/socket.h>
 #include <sys/uio.h>
-
 #include <errno.h>  
 
+#include <atalk/adouble.h>
 #include <atalk/logger.h>
-#include "ad_private.h"
+
+#include "ad_lock.h"
 
 #if defined(LINUX_BROKEN_SENDFILE_API)