From 245c6d39387bf85b18ea8c4db161f693739fca26 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Thu, 4 Sep 2014 15:03:30 -0500 Subject: [PATCH] LU-5587 lustre: require HAVE_SERVER_SUPPORT in md_object.h Move the definition of struct seq_server_site from md_object.h to lustre_fid.h. Uninclude md_object.h from files that don't need it. In md_object.h generate a preprocessor error if HAVE_SERVER_SUPPORT is not defined. Signed-off-by: John L. Hammond Change-Id: Ie3fd464ef4a71f09ccaffae409901cb48705301b Reviewed-on: http://review.whamcloud.com/11756 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Bob Glossman Reviewed-by: Oleg Drokin --- lustre/fid/fid_handler.c | 1 - lustre/fid/fid_store.c | 1 - lustre/fid/lproc_fid.c | 1 - lustre/fld/fld_handler.c | 1 - lustre/fld/lproc_fld.c | 1 - lustre/include/lustre_fid.h | 29 +++++++++++++++++++++++++++++ lustre/include/md_object.h | 36 ++++-------------------------------- lustre/obdclass/Makefile.in | 20 ++++++++++++++------ lustre/obdecho/echo_client.c | 4 +++- 9 files changed, 50 insertions(+), 44 deletions(-) diff --git a/lustre/fid/fid_handler.c b/lustre/fid/fid_handler.c index 2e3efff..c44f031 100644 --- a/lustre/fid/fid_handler.c +++ b/lustre/fid/fid_handler.c @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include diff --git a/lustre/fid/fid_store.c b/lustre/fid/fid_store.c index 40276d5..bb5836b 100644 --- a/lustre/fid/fid_store.c +++ b/lustre/fid/fid_store.c @@ -44,7 +44,6 @@ #include #include -#include #include #include #include diff --git a/lustre/fid/lproc_fid.c b/lustre/fid/lproc_fid.c index 3f2cd68..5adbf62 100644 --- a/lustre/fid/lproc_fid.c +++ b/lustre/fid/lproc_fid.c @@ -50,7 +50,6 @@ #include #include #include "fid_internal.h" -#include #ifdef LPROCFS diff --git a/lustre/fld/fld_handler.c b/lustre/fld/fld_handler.c index 468d32f..0e80de8 100644 --- a/lustre/fld/fld_handler.c +++ b/lustre/fld/fld_handler.c @@ -51,7 +51,6 @@ #include #include #include -#include #include #include #include "fld_internal.h" diff --git a/lustre/fld/lproc_fld.c b/lustre/fld/lproc_fld.c index 8dd6fe4..1eb2346 100644 --- a/lustre/fld/lproc_fld.c +++ b/lustre/fld/lproc_fld.c @@ -50,7 +50,6 @@ #include #include #include "fld_internal.h" -#include #ifdef LPROCFS static int diff --git a/lustre/include/lustre_fid.h b/lustre/include/lustre_fid.h index 6436632..0d957aa 100644 --- a/lustre/include/lustre_fid.h +++ b/lustre/include/lustre_fid.h @@ -444,6 +444,35 @@ struct lu_server_seq { struct seq_server_site *lss_site; }; +struct seq_server_site { + struct lu_site *ss_lu; + /** + * mds number of this site. + */ + u32 ss_node_id; + /** + * Fid location database + */ + struct lu_server_fld *ss_server_fld; + struct lu_client_fld *ss_client_fld; + + /** + * Server Seq Manager + */ + struct lu_server_seq *ss_server_seq; + + /** + * Controller Seq Manager + */ + struct lu_server_seq *ss_control_seq; + struct obd_export *ss_control_exp; + + /** + * Client Seq Manager + */ + struct lu_client_seq *ss_client_seq; +}; + /* Server methods */ int seq_server_init(const struct lu_env *env, diff --git a/lustre/include/md_object.h b/lustre/include/md_object.h index cf7b4a5..a93e09d 100644 --- a/lustre/include/md_object.h +++ b/lustre/include/md_object.h @@ -41,6 +41,10 @@ #ifndef _LUSTRE_MD_OBJECT_H #define _LUSTRE_MD_OBJECT_H +#ifndef HAVE_SERVER_SUPPORT +# error "client code should not depend on md_object.h" +#endif /* !HAVE_SERVER_SUPPORT */ + /** \defgroup md md * Sub-class of lu_object with methods common for "meta-data" objects in MDT * stack. @@ -431,38 +435,6 @@ struct md_object { * the dead object. */ #define LUSTRE_SLAVE_DEAD_FL 0x80000000 -/** - * seq-server site. - */ -struct seq_server_site { - struct lu_site *ss_lu; - /** - * mds number of this site. - */ - u32 ss_node_id; - /** - * Fid location database - */ - struct lu_server_fld *ss_server_fld; - struct lu_client_fld *ss_client_fld; - - /** - * Server Seq Manager - */ - struct lu_server_seq *ss_server_seq; - - /** - * Controller Seq Manager - */ - struct lu_server_seq *ss_control_seq; - struct obd_export *ss_control_exp; - - /** - * Client Seq Manager - */ - struct lu_client_seq *ss_client_seq; -}; - static inline struct md_device *lu2md_dev(const struct lu_device *d) { LASSERT(IS_ERR(d) || lu_device_is_md(d)); diff --git a/lustre/obdclass/Makefile.in b/lustre/obdclass/Makefile.in index d6aeb7c..a8e589b 100644 --- a/lustre/obdclass/Makefile.in +++ b/lustre/obdclass/Makefile.in @@ -12,11 +12,14 @@ obdclass-all-objs += lustre_handles.o lustre_peer.o local_storage.o obdclass-all-objs += statfs_pack.o obdo.o obd_config.o obd_mount.o obdclass-all-objs += lu_object.o dt_object.o capa.o obdclass-all-objs += cl_object.o cl_page.o cl_lock.o cl_io.o lu_ref.o -obdclass-all-objs += acl.o idmap.o -obdclass-all-objs += md_attrs.o linkea.o -obdclass-all-objs += lu_ucred.o - -@SERVER_TRUE@obdclass-all-objs += lprocfs_status_server.o lprocfs_jobstats.o +obdclass-all-objs += acl.o +obdclass-all-objs += linkea.o + +@SERVER_TRUE@obdclass-all-objs += idmap.o +@SERVER_TRUE@obdclass-all-objs += lprocfs_jobstats.o +@SERVER_TRUE@obdclass-all-objs += lprocfs_status_server.o +@SERVER_TRUE@obdclass-all-objs += lu_ucred.o +@SERVER_TRUE@obdclass-all-objs += md_attrs.o @SERVER_TRUE@obdclass-all-objs += obd_mount_server.o obdclass-objs := $(obdclass-linux-objs) $(obdclass-all-objs) @@ -25,7 +28,12 @@ EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@LDISKFS_DIR@ -I@LDISKFS_DIR@/ldiskfs EXTRA_DIST = $(obdclass-all-objs:.o=.c) llog_test.c llog_internal.h EXTRA_DIST += cl_internal.h local_storage.h -@SERVER_FALSE@EXTRA_DIST += lprocfs_jobstats.c lprocfs_status_server.c + +@SERVER_FALSE@EXTRA_DIST += idmap.c +@SERVER_FALSE@EXTRA_DIST += lprocfs_jobstats.c +@SERVER_FALSE@EXTRA_DIST += lprocfs_status_server.c +@SERVER_FALSE@EXTRA_DIST += lu_ucred.c +@SERVER_FALSE@EXTRA_DIST += md_attrs.c @SERVER_FALSE@EXTRA_DIST += obd_mount_server.c @INCLUDE_RULES@ diff --git a/lustre/obdecho/echo_client.c b/lustre/obdecho/echo_client.c index 53ffaa2..f7ddd24 100644 --- a/lustre/obdecho/echo_client.c +++ b/lustre/obdecho/echo_client.c @@ -43,11 +43,13 @@ #include #include #include -#include #include #include #include #include +#ifdef HAVE_SERVER_SUPPORT +# include +#endif /* HAVE_SERVER_SUPPORT */ #include "echo_internal.h" -- 1.8.3.1