Whamcloud - gitweb
r=adilger,phil
authorjacob <jacob>
Tue, 9 Mar 2004 00:15:38 +0000 (00:15 +0000)
committerjacob <jacob>
Tue, 9 Mar 2004 00:15:38 +0000 (00:15 +0000)
b=2464

Land initial b_bgl fixes.  Includes compile and a couple of swabbing
fixes.

16 files changed:
lnet/archdep.m4
lnet/include/lnet/types.h
lnet/klnds/socklnd/socklnd.h
lnet/utils/Makefile.am
lustre/include/linux/lustre_cfg.h
lustre/ldlm/ldlm_lockd.c
lustre/llite/llite_lib.c
lustre/mdc/mdc_request.c
lustre/mds/mds_open.c
lustre/obdclass/obd_config.c
lustre/obdfilter/filter.c
lustre/obdfilter/filter_io_24.c
lustre/portals/archdep.m4
lustre/portals/include/portals/types.h
lustre/portals/knals/socknal/socknal.h
lustre/portals/utils/Makefile.am

index 3bdaf32..7801957 100644 (file)
@@ -133,8 +133,8 @@ case ${host_cpu} in
 
        powerpc )
        AC_MSG_RESULT($host_cpu)
-        KCFLAGS='-O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -D__powerpc__ -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring'
-        KCPPFLAGS='-D__KERNEL__'
+        KCFLAGS='-O2 -g -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -D__powerpc__ -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring'
+        KCPPFLAGS='-D__KERNEL__ -DMODULE'
         MOD_LINK=elf32ppclinux
 ;;
 
@@ -338,6 +338,18 @@ AC_SUBST(MOD_LINK)
 AC_SUBST(LINUX25)
 AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib)
 
+# ---------- Red Hat 2.4.18 has iobuf->dovary --------------
+# But other kernels don't
+
+AC_MSG_CHECKING([if struct kiobuf has a dovary field])
+AC_TRY_COMPILE([#define __KERNEL__
+               #include <linux/iobuf.h>],
+              [struct kiobuf iobuf;
+               iobuf.dovary = 1;],
+              [AC_MSG_RESULT([yes])
+                CPPFLAGS="$CPPFLAGS -DHAVE_KIOBUF_DOVARY"],
+              [AC_MSG_RESULT([no])])
+
 # ---------- Red Hat 2.4.20 backports some 2.5 bits --------
 # This needs to run after we've defined the KCPPFLAGS
 
index 7ffe797..ccce5d5 100644 (file)
@@ -1,21 +1,20 @@
 #ifndef _P30_TYPES_H_
 #define _P30_TYPES_H_
 
-#ifdef __linux__
+#ifdef __KERNEL__
+# include <linux/time.h>
 # include <asm/types.h>
 # include <asm/timex.h>
-#else
+#else /* !__KERNEL__ */
 # include <sys/types.h>
+# include <sys/time.h>
 typedef u_int32_t __u32;
 typedef u_int64_t __u64;
-#endif
-
-#ifdef __KERNEL__
-# include <linux/time.h>
-#else
-# include <sys/time.h>
 # define do_gettimeofday(tv) gettimeofday(tv, NULL)
-#endif
+# ifndef cycles_t
+typedef unsigned long cycles_t;
+# endif
+#endif /* !__KERNEL__ */
 
 #include <portals/errno.h>
 
@@ -129,7 +128,7 @@ typedef struct {
         struct timeval     arrival_time;
 
         volatile ptl_seq_t sequence;
-} ptl_event_t;
+} __attribute__((packed)) ptl_event_t;
 #ifdef __CYGWIN__
 #pragma pop
 #endif
index 2767c41..db8c842 100644 (file)
@@ -44,6 +44,7 @@
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
+#include <asm/irq.h>
 
 #include <linux/init.h>
 #include <linux/fs.h>
index 6c31b3d..925406f 100644 (file)
@@ -26,11 +26,11 @@ libptlctl_a_SOURCES = portals.c debug.c l_ioctl.c parser.c parser.h
 gmnalnid_SOURCES = gmnalnid.c
 
 ptlctl_SOURCES = ptlctl.c
-ptlctl_LDADD =  -L. -lptlctl -lncurses # -lefence
+ptlctl_LDADD =  -L. -lptlctl $(LIBREADLINE) $(LIBEFENCE)
 ptlctl_DEPENDENCIES = libptlctl.a
 
 debugctl_SOURCES = debugctl.c
-debugctl_LDADD = -L. -lptlctl -lncurses # -lefence
+debugctl_LDADD = -L. -lptlctl $(LIBREADLINE) $(LIBEFENCE)
 debugctl_DEPENDENCIES = libptlctl.a
 
 routerstat_SOURCES = routerstat.c
index d8c84be..4f230d2 100644 (file)
@@ -119,8 +119,6 @@ static inline int lustre_cfg_pack(struct lustre_cfg *data, char **pbuf,
                 LOGL(data->lcfg_inlbuf3, data->lcfg_inllen3, ptr);
         if (data->lcfg_inlbuf4)
                 LOGL(data->lcfg_inlbuf4, data->lcfg_inllen4, ptr);
-//        if (lustre_cfg_is_invalid(overlay))
-//                return 1;
 
        *plen = len;
 
@@ -200,14 +198,11 @@ static inline int lustre_cfg_getdata(char **buf, int len, void *arg, int kernel)
         lcfg = (struct lustre_cfg *)*buf;
 
         if (lcfg->lcfg_version != LUSTRE_CFG_VERSION) {
-                CERROR("Version mismatch kernel vs application\n");
+                CERROR("Version mismatch kernel: %#x application: %#x\n",
+                       LUSTRE_CFG_VERSION, lcfg->lcfg_version);
                 return -EINVAL;
         }
 
-//        if (lustre_cfg_is_invalid(data)) {
-//                CERROR("ioctl not correctly formatted\n");
-//                return -EINVAL;
-//        }
 
         if (lcfg->lcfg_dev_name) {
                 lcfg->lcfg_dev_name = &lcfg->lcfg_bulk[0];
index 886097f..6602713 100644 (file)
@@ -37,6 +37,7 @@
 
 #include <linux/lustre_dlm.h>
 #include <linux/obd_class.h>
+#include <portals/list.h>
 #include "ldlm_internal.h"
 
 extern kmem_cache_t *ldlm_resource_slab;
index c17ad63..c9cf119 100644 (file)
@@ -462,7 +462,14 @@ int lustre_process_log(struct lustre_mount_data *lmd, char * profile,
         exp = class_conn2export(&mdc_conn);
 
         ctxt = llog_get_context(exp->exp_obd, LLOG_CONFIG_REPL_CTXT);
+#if 1
         rc = class_config_parse_llog(ctxt, profile, cfg);
+#else
+        /*
+         * For debugging, it's useful to just dump the log
+         */
+        rc = class_config_dump_llog(ctxt, profile, cfg);
+#endif
         if (rc) {
                 CERROR("class_config_parse_llog failed: rc = %d\n", rc);
         }
index c692def..e1c3fed 100644 (file)
@@ -507,6 +507,11 @@ int mdc_close(struct obd_export *exp, struct obdo *obdo,
                         CERROR("Unexpected: can't find mdc_open_data, but the "
                                "close succeeded.  Please tell CFS.\n");
                 }
+                if (!lustre_swab_repbuf(req, 0, sizeof(struct mds_body),
+                                        lustre_swab_mds_body)) {
+                        CERROR("Error unpacking mds_body\n");
+                        rc = -EPROTO;
+                }
         }
         if (req->rq_async_args.pointer_arg[0] != NULL) {
                 CERROR("returned without dropping rpc_lock: rc %d\n", rc);
index 8d49420..e959402 100644 (file)
@@ -28,6 +28,7 @@
 #endif
 #define DEBUG_SUBSYSTEM S_MDS
 
+#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/version.h>
index 9156dc8..41f2258 100644 (file)
@@ -545,7 +545,7 @@ static int class_config_llog_handler(struct llog_handle * handle,
         int cfg_len = rec->lrh_len;
         char *cfg_buf = (char*) (rec + 1);
         int rc = 0;
-
+        ENTRY;
         if (rec->lrh_type == OBD_CFG_REC) {
                 char *buf;
                 struct lustre_cfg *lcfg;
@@ -641,7 +641,7 @@ static int class_config_dump_handler(struct llog_handle * handle,
         int cfg_len = rec->lrh_len;
         char *cfg_buf = (char*) (rec + 1);
         int rc = 0;
-
+        ENTRY;
         if (rec->lrh_type == OBD_CFG_REC) {
                 char *buf;
                 struct lustre_cfg *lcfg;
@@ -702,6 +702,9 @@ static int class_config_dump_handler(struct llog_handle * handle,
                 if (pcfg->pcfg_flags)
                         CDEBUG(D_INFO, "       flags: %x\n",
                                pcfg->pcfg_flags);
+        } else {
+                CERROR("unhandled lrh_type: %#x\n", rec->lrh_type);
+                rc = -EINVAL;
         }
 out:
         RETURN(rc);
index 5d9b641..e90fb45 100644 (file)
@@ -53,6 +53,7 @@
 #include <linux/lprocfs_status.h>
 #include <linux/lustre_log.h>
 #include <linux/lustre_commit_confd.h>
+#include <portals/list.h>
 
 #include "filter_internal.h"
 
index 6ab28db..15ac8e9 100644 (file)
@@ -251,7 +251,7 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, int objcount,
                 GOTO(cleanup, rc);
         cleanup_phase = 1;
 
-#if (LINUX_VERSION_CODE == KERNEL_VERSION(2,4,18))
+#ifdef HAVE_KIOBUF_DOVARY
         iobuf->dovary = 0; /* this prevents corruption, not present in 2.4.20 */
 #endif
         rc = expand_kiobuf(iobuf, obj->ioo_bufcnt);
index 3bdaf32..7801957 100644 (file)
@@ -133,8 +133,8 @@ case ${host_cpu} in
 
        powerpc )
        AC_MSG_RESULT($host_cpu)
-        KCFLAGS='-O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -D__powerpc__ -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring'
-        KCPPFLAGS='-D__KERNEL__'
+        KCFLAGS='-O2 -g -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -D__powerpc__ -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring'
+        KCPPFLAGS='-D__KERNEL__ -DMODULE'
         MOD_LINK=elf32ppclinux
 ;;
 
@@ -338,6 +338,18 @@ AC_SUBST(MOD_LINK)
 AC_SUBST(LINUX25)
 AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib)
 
+# ---------- Red Hat 2.4.18 has iobuf->dovary --------------
+# But other kernels don't
+
+AC_MSG_CHECKING([if struct kiobuf has a dovary field])
+AC_TRY_COMPILE([#define __KERNEL__
+               #include <linux/iobuf.h>],
+              [struct kiobuf iobuf;
+               iobuf.dovary = 1;],
+              [AC_MSG_RESULT([yes])
+                CPPFLAGS="$CPPFLAGS -DHAVE_KIOBUF_DOVARY"],
+              [AC_MSG_RESULT([no])])
+
 # ---------- Red Hat 2.4.20 backports some 2.5 bits --------
 # This needs to run after we've defined the KCPPFLAGS
 
index 7ffe797..ccce5d5 100644 (file)
@@ -1,21 +1,20 @@
 #ifndef _P30_TYPES_H_
 #define _P30_TYPES_H_
 
-#ifdef __linux__
+#ifdef __KERNEL__
+# include <linux/time.h>
 # include <asm/types.h>
 # include <asm/timex.h>
-#else
+#else /* !__KERNEL__ */
 # include <sys/types.h>
+# include <sys/time.h>
 typedef u_int32_t __u32;
 typedef u_int64_t __u64;
-#endif
-
-#ifdef __KERNEL__
-# include <linux/time.h>
-#else
-# include <sys/time.h>
 # define do_gettimeofday(tv) gettimeofday(tv, NULL)
-#endif
+# ifndef cycles_t
+typedef unsigned long cycles_t;
+# endif
+#endif /* !__KERNEL__ */
 
 #include <portals/errno.h>
 
@@ -129,7 +128,7 @@ typedef struct {
         struct timeval     arrival_time;
 
         volatile ptl_seq_t sequence;
-} ptl_event_t;
+} __attribute__((packed)) ptl_event_t;
 #ifdef __CYGWIN__
 #pragma pop
 #endif
index 2767c41..db8c842 100644 (file)
@@ -44,6 +44,7 @@
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
+#include <asm/irq.h>
 
 #include <linux/init.h>
 #include <linux/fs.h>
index 6c31b3d..925406f 100644 (file)
@@ -26,11 +26,11 @@ libptlctl_a_SOURCES = portals.c debug.c l_ioctl.c parser.c parser.h
 gmnalnid_SOURCES = gmnalnid.c
 
 ptlctl_SOURCES = ptlctl.c
-ptlctl_LDADD =  -L. -lptlctl -lncurses # -lefence
+ptlctl_LDADD =  -L. -lptlctl $(LIBREADLINE) $(LIBEFENCE)
 ptlctl_DEPENDENCIES = libptlctl.a
 
 debugctl_SOURCES = debugctl.c
-debugctl_LDADD = -L. -lptlctl -lncurses # -lefence
+debugctl_LDADD = -L. -lptlctl $(LIBREADLINE) $(LIBEFENCE)
 debugctl_DEPENDENCIES = libptlctl.a
 
 routerstat_SOURCES = routerstat.c