From ce41a66530a855e74ff4ff181bd0efd52978b9b4 Mon Sep 17 00:00:00 2001 From: zab Date: Mon, 19 May 2003 23:05:22 +0000 Subject: [PATCH] get libcfs/ and portals/ building - add portals kernel_compat header - get THREAD_SIZE from the kernel - minor typos in makefiles, don't ask to build non-existant files - continue to fix up the const propogation --- lnet/include/linux/kp30.h | 8 +------- lnet/libcfs/Makefile.mk | 2 +- lnet/libcfs/debug.c | 11 ++++++----- lnet/libcfs/module.c | 7 ++++--- lnet/lnet/Makefile.mk | 7 +++++-- lnet/ulnds/debug.c | 4 ++-- lnet/ulnds/socklnd/debug.c | 4 ++-- lustre/portals/include/linux/kp30.h | 8 +------- lustre/portals/libcfs/Makefile.mk | 2 +- lustre/portals/libcfs/debug.c | 11 ++++++----- lustre/portals/libcfs/module.c | 7 ++++--- lustre/portals/portals/Makefile.mk | 7 +++++-- lustre/portals/unals/debug.c | 4 ++-- 13 files changed, 40 insertions(+), 42 deletions(-) diff --git a/lnet/include/linux/kp30.h b/lnet/include/linux/kp30.h index 61d13de..f45f3c4 100644 --- a/lnet/include/linux/kp30.h +++ b/lnet/include/linux/kp30.h @@ -80,9 +80,7 @@ extern unsigned int portal_printk; #define D_RPCTRACE (1 << 20) /* for distributed debugging */ #define D_VFSTRACE (1 << 21) -#ifndef THREAD_SIZE -#define THREAD_SIZE 8192 -#endif +#include /* THREAD_SIZE */ #ifdef __arch_ia64__ #define CDEBUG_STACK(var) (&var & (THREAD_SIZE - 1)) #else @@ -620,10 +618,6 @@ extern void kportal_blockallsigs (void); getpid() , stack, ## a); #endif -#ifndef CURRENT_TIME -# define CURRENT_TIME time(0) -#endif - #include /* diff --git a/lnet/libcfs/Makefile.mk b/lnet/libcfs/Makefile.mk index 3196ea2..9aa838f 100644 --- a/lnet/libcfs/Makefile.mk +++ b/lnet/libcfs/Makefile.mk @@ -6,4 +6,4 @@ include fs/lustre/portals/Kernelenv obj-y += libcfs.o -licfs-objs := module.o proc.o debug.o \ No newline at end of file +libcfs-objs := module.o proc.o debug.o diff --git a/lnet/libcfs/debug.c b/lnet/libcfs/debug.c index 786a338..0af515e 100644 --- a/lnet/libcfs/debug.c +++ b/lnet/libcfs/debug.c @@ -48,6 +48,7 @@ # define DEBUG_SUBSYSTEM S_PORTALS #include +#include #define DEBUG_OVERFLOW 1024 static char *debug_buf = NULL; @@ -233,7 +234,7 @@ int portals_do_debug_dumplog(void *arg) reparent_to_init(); journal_info = current->journal_info; current->journal_info = NULL; - sprintf(debug_file_name, "%s.%ld", debug_file_path, CURRENT_TIME); + sprintf(debug_file_name, "%s.%ld", debug_file_path, CURRENT_SECONDS); file = filp_open(debug_file_name, O_CREAT|O_TRUNC|O_RDWR, 0644); if (!file || IS_ERR(file)) { @@ -663,8 +664,8 @@ __s32 portals_debug_copy_to_user(char *buf, unsigned long len) /* FIXME: I'm not very smart; someone smarter should make this better. */ void -portals_debug_msg (int subsys, int mask, char *file, char *fn, int line, - unsigned long stack, const char *format, ...) +portals_debug_msg (int subsys, int mask, char *file, const char *fn, + const int line, unsigned long stack, const char *format, ...) { va_list ap; unsigned long flags; @@ -794,7 +795,7 @@ void portals_run_lbug_upcall(char * file, const char *fn, const int line) argv[0] = portals_upcall; argv[1] = "LBUG"; argv[2] = file; - argv[3] = fn; + argv[3] = (char *)fn; argv[4] = buf; argv[5] = NULL; @@ -802,7 +803,7 @@ void portals_run_lbug_upcall(char * file, const char *fn, const int line) envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; envp[2] = NULL; - rc = call_usermodehelper(argv[0], argv, envp); + rc = USERMODEHELPER(argv[0], argv, envp); if (rc < 0) { CERROR("Error invoking lbug upcall %s %s %s %s %s: %d; check " "/proc/sys/portals/upcall\n", diff --git a/lnet/libcfs/module.c b/lnet/libcfs/module.c index faa9d01..79964d2 100644 --- a/lnet/libcfs/module.c +++ b/lnet/libcfs/module.c @@ -45,6 +45,7 @@ #include #include #include +#include #define PORTAL_MINOR 240 @@ -85,10 +86,10 @@ kportal_blockallsigs () { unsigned long flags; - spin_lock_irqsave (¤t->sigmask_lock, flags); + SIGNAL_MASK_LOCK(current, flags); siginitsetinv (¤t->blocked, 0); - recalc_sigpending (current); - spin_unlock_irqrestore (¤t->sigmask_lock, flags); + RECALC_SIGPENDING(); + SIGNAL_MASK_UNLOCK(current, flags); } /* called when opening /dev/device */ diff --git a/lnet/lnet/Makefile.mk b/lnet/lnet/Makefile.mk index 5627ef7..3fc8d36 100644 --- a/lnet/lnet/Makefile.mk +++ b/lnet/lnet/Makefile.mk @@ -3,7 +3,10 @@ # This code is issued under the GNU General Public License. # See the file COPYING in this distribution -include ../Kernelenv +include $(obj)/../Kernelenv obj-y += portals.o -portals-objs := lib-dispatch.o lib-eq.o lib-init.o lib-md.o lib-me.o lib-move.o lib-msg.o lib-ni.o lib-not-impl.o lib-pid.o api-eq.o api-errno.o api-init.o api-md.o api-me.o api-ni.o api-wrap.o +portals-objs := lib-dispatch.o lib-eq.o lib-init.o lib-md.o lib-me.o \ + lib-move.o lib-msg.o lib-ni.o lib-pid.o \ + api-eq.o api-errno.o api-init.o api-me.o api-ni.o \ + api-wrap.o diff --git a/lnet/ulnds/debug.c b/lnet/ulnds/debug.c index 529bb2d..b73f042 100644 --- a/lnet/ulnds/debug.c +++ b/lnet/ulnds/debug.c @@ -84,8 +84,8 @@ int portals_debug_copy_to_user(char *buf, unsigned long len) /* FIXME: I'm not very smart; someone smarter should make this better. */ void -portals_debug_msg (int subsys, int mask, char *file, char *fn, int line, - const char *format, ...) +portals_debug_msg (int subsys, int mask, char *file, const char *fn, + const int line, const char *format, ...) { va_list ap; unsigned long flags; diff --git a/lnet/ulnds/socklnd/debug.c b/lnet/ulnds/socklnd/debug.c index 529bb2d..b73f042 100644 --- a/lnet/ulnds/socklnd/debug.c +++ b/lnet/ulnds/socklnd/debug.c @@ -84,8 +84,8 @@ int portals_debug_copy_to_user(char *buf, unsigned long len) /* FIXME: I'm not very smart; someone smarter should make this better. */ void -portals_debug_msg (int subsys, int mask, char *file, char *fn, int line, - const char *format, ...) +portals_debug_msg (int subsys, int mask, char *file, const char *fn, + const int line, const char *format, ...) { va_list ap; unsigned long flags; diff --git a/lustre/portals/include/linux/kp30.h b/lustre/portals/include/linux/kp30.h index 61d13de..f45f3c4 100644 --- a/lustre/portals/include/linux/kp30.h +++ b/lustre/portals/include/linux/kp30.h @@ -80,9 +80,7 @@ extern unsigned int portal_printk; #define D_RPCTRACE (1 << 20) /* for distributed debugging */ #define D_VFSTRACE (1 << 21) -#ifndef THREAD_SIZE -#define THREAD_SIZE 8192 -#endif +#include /* THREAD_SIZE */ #ifdef __arch_ia64__ #define CDEBUG_STACK(var) (&var & (THREAD_SIZE - 1)) #else @@ -620,10 +618,6 @@ extern void kportal_blockallsigs (void); getpid() , stack, ## a); #endif -#ifndef CURRENT_TIME -# define CURRENT_TIME time(0) -#endif - #include /* diff --git a/lustre/portals/libcfs/Makefile.mk b/lustre/portals/libcfs/Makefile.mk index 3196ea2..9aa838f 100644 --- a/lustre/portals/libcfs/Makefile.mk +++ b/lustre/portals/libcfs/Makefile.mk @@ -6,4 +6,4 @@ include fs/lustre/portals/Kernelenv obj-y += libcfs.o -licfs-objs := module.o proc.o debug.o \ No newline at end of file +libcfs-objs := module.o proc.o debug.o diff --git a/lustre/portals/libcfs/debug.c b/lustre/portals/libcfs/debug.c index 786a338..0af515e 100644 --- a/lustre/portals/libcfs/debug.c +++ b/lustre/portals/libcfs/debug.c @@ -48,6 +48,7 @@ # define DEBUG_SUBSYSTEM S_PORTALS #include +#include #define DEBUG_OVERFLOW 1024 static char *debug_buf = NULL; @@ -233,7 +234,7 @@ int portals_do_debug_dumplog(void *arg) reparent_to_init(); journal_info = current->journal_info; current->journal_info = NULL; - sprintf(debug_file_name, "%s.%ld", debug_file_path, CURRENT_TIME); + sprintf(debug_file_name, "%s.%ld", debug_file_path, CURRENT_SECONDS); file = filp_open(debug_file_name, O_CREAT|O_TRUNC|O_RDWR, 0644); if (!file || IS_ERR(file)) { @@ -663,8 +664,8 @@ __s32 portals_debug_copy_to_user(char *buf, unsigned long len) /* FIXME: I'm not very smart; someone smarter should make this better. */ void -portals_debug_msg (int subsys, int mask, char *file, char *fn, int line, - unsigned long stack, const char *format, ...) +portals_debug_msg (int subsys, int mask, char *file, const char *fn, + const int line, unsigned long stack, const char *format, ...) { va_list ap; unsigned long flags; @@ -794,7 +795,7 @@ void portals_run_lbug_upcall(char * file, const char *fn, const int line) argv[0] = portals_upcall; argv[1] = "LBUG"; argv[2] = file; - argv[3] = fn; + argv[3] = (char *)fn; argv[4] = buf; argv[5] = NULL; @@ -802,7 +803,7 @@ void portals_run_lbug_upcall(char * file, const char *fn, const int line) envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; envp[2] = NULL; - rc = call_usermodehelper(argv[0], argv, envp); + rc = USERMODEHELPER(argv[0], argv, envp); if (rc < 0) { CERROR("Error invoking lbug upcall %s %s %s %s %s: %d; check " "/proc/sys/portals/upcall\n", diff --git a/lustre/portals/libcfs/module.c b/lustre/portals/libcfs/module.c index faa9d01..79964d2 100644 --- a/lustre/portals/libcfs/module.c +++ b/lustre/portals/libcfs/module.c @@ -45,6 +45,7 @@ #include #include #include +#include #define PORTAL_MINOR 240 @@ -85,10 +86,10 @@ kportal_blockallsigs () { unsigned long flags; - spin_lock_irqsave (¤t->sigmask_lock, flags); + SIGNAL_MASK_LOCK(current, flags); siginitsetinv (¤t->blocked, 0); - recalc_sigpending (current); - spin_unlock_irqrestore (¤t->sigmask_lock, flags); + RECALC_SIGPENDING(); + SIGNAL_MASK_UNLOCK(current, flags); } /* called when opening /dev/device */ diff --git a/lustre/portals/portals/Makefile.mk b/lustre/portals/portals/Makefile.mk index 5627ef7..3fc8d36 100644 --- a/lustre/portals/portals/Makefile.mk +++ b/lustre/portals/portals/Makefile.mk @@ -3,7 +3,10 @@ # This code is issued under the GNU General Public License. # See the file COPYING in this distribution -include ../Kernelenv +include $(obj)/../Kernelenv obj-y += portals.o -portals-objs := lib-dispatch.o lib-eq.o lib-init.o lib-md.o lib-me.o lib-move.o lib-msg.o lib-ni.o lib-not-impl.o lib-pid.o api-eq.o api-errno.o api-init.o api-md.o api-me.o api-ni.o api-wrap.o +portals-objs := lib-dispatch.o lib-eq.o lib-init.o lib-md.o lib-me.o \ + lib-move.o lib-msg.o lib-ni.o lib-pid.o \ + api-eq.o api-errno.o api-init.o api-me.o api-ni.o \ + api-wrap.o diff --git a/lustre/portals/unals/debug.c b/lustre/portals/unals/debug.c index 529bb2d..b73f042 100644 --- a/lustre/portals/unals/debug.c +++ b/lustre/portals/unals/debug.c @@ -84,8 +84,8 @@ int portals_debug_copy_to_user(char *buf, unsigned long len) /* FIXME: I'm not very smart; someone smarter should make this better. */ void -portals_debug_msg (int subsys, int mask, char *file, char *fn, int line, - const char *format, ...) +portals_debug_msg (int subsys, int mask, char *file, const char *fn, + const int line, const char *format, ...) { va_list ap; unsigned long flags; -- 1.8.3.1