[Ocfs2-tools-devel] [PATCH 05/11] libo2dlm: Make the internal structures private.

Joel Becker joel.becker at oracle.com
Tue May 27 18:44:25 PDT 2008


The public header describes many of the structures that are internal to
the library.  Move them into o2dlm.c.

Signed-off-by: Joel Becker <joel.becker at oracle.com>
---
 include/o2dlm/o2dlm.h |   24 +++---------------------
 libo2dlm/Makefile     |    2 +-
 libo2dlm/o2dlm.c      |   24 ++++++++++++++++++++++++
 3 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/include/o2dlm/o2dlm.h b/include/o2dlm/o2dlm.h
index 89634e3..e6aed2c 100644
--- a/include/o2dlm/o2dlm.h
+++ b/include/o2dlm/o2dlm.h
@@ -36,7 +36,6 @@
 
 #include <et/com_err.h>
 
-#include <ocfs2-kernel/kernel-list.h>
 #include <o2dlm/o2dlm_err.h>
 
 #define O2DLM_LOCK_ID_MAX_LEN       32
@@ -49,6 +48,9 @@
 #define O2DLM_TRYLOCK      0x01
 #define O2DLM_VALID_FLAGS  (O2DLM_TRYLOCK)
 
+/* Forward declarations */
+struct o2dlm_ctxt;
+
 /* valid lock levels */
 enum o2dlm_lock_level
 {
@@ -56,26 +58,6 @@ enum o2dlm_lock_level
 	O2DLM_LEVEL_EXMODE
 };
 
-struct o2dlm_lock_res
-{
-	struct list_head      l_bucket; /* to hang us off the locks list */
-	char                  l_id[O2DLM_LOCK_ID_MAX_LEN]; /* 32 byte,
-							    * null
-							    * terminated
-							    * string */
-	int                   l_flags; /* limited set of flags */
-	enum o2dlm_lock_level l_level; /* either PR or EX */
-	int                   l_fd;    /* the fd returned by the open call */
-};
-
-struct o2dlm_ctxt
-{
-	struct list_head *ct_hash;
-	unsigned int     ct_hash_size;
-	char             ct_domain_path[O2DLM_MAX_FULL_DOMAIN_PATH]; /* domain
-								      * dir */
-	char             ct_ctxt_lock_name[O2DLM_LOCK_ID_MAX_LEN];
-};
 
 /* Expects to be given a path to the root of a valid ocfs2_dlmfs file
  * system and a domain identifier of length <= 255 characters including
diff --git a/libo2dlm/Makefile b/libo2dlm/Makefile
index 116d31a..c176ef7 100644
--- a/libo2dlm/Makefile
+++ b/libo2dlm/Makefile
@@ -35,7 +35,7 @@ HFILES_GEN = o2dlm_err.h
 OBJS = $(subst .c,.o,$(CFILES)) \
 	o2dlm_err.o
 
-$(OBJS): $(HFILES_GEN)
+$(OBJS): $(HFILES) $(HFILES_GEN)
 
 TESTING_OBJS = $(subst .c,.o,$(TESTING_CFILES))
 
diff --git a/libo2dlm/o2dlm.c b/libo2dlm/o2dlm.c
index 047ef99..1c33f9a 100644
--- a/libo2dlm/o2dlm.c
+++ b/libo2dlm/o2dlm.c
@@ -39,9 +39,33 @@
 #include <string.h>
 
 #include "o2dlm/o2dlm.h"
+#include "ocfs2-kernel/kernel-list.h"
 
 #define USER_DLMFS_MAGIC	0x76a9f425
 
+
+struct o2dlm_lock_res
+{
+	struct list_head      l_bucket; /* to hang us off the locks list */
+	char                  l_id[O2DLM_LOCK_ID_MAX_LEN]; /* 32 byte,
+							    * null
+							    * terminated
+							    * string */
+	int                   l_flags; /* limited set of flags */
+	enum o2dlm_lock_level l_level; /* either PR or EX */
+	int                   l_fd;    /* the fd returned by the open call */
+};
+
+struct o2dlm_ctxt
+{
+	struct list_head *ct_hash;
+	unsigned int     ct_hash_size;
+	char             ct_domain_path[O2DLM_MAX_FULL_DOMAIN_PATH]; /* domain
+								      * dir */
+	char             ct_ctxt_lock_name[O2DLM_LOCK_ID_MAX_LEN];
+};
+
+#
 static errcode_t o2dlm_lock_nochecks(struct o2dlm_ctxt *ctxt,
 				     const char *lockid,
 				     int lockflags,
-- 
1.5.4.5




More information about the Ocfs2-tools-devel mailing list