if LINUX25
-basename=$(shell echo $< | sed -e 's/\.c//g' | sed -e 's/-//g' | sed -e 's/\.o//g')
+basename=$(shell echo $< | sed -e 's/\.c//g' | sed -e 's/-//g' | sed -e 's/\.o//g' | sed -e 's/^.*\///g')
AM_CPPFLAGS= -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -DKBUILD_MODNAME=$(MODULE) -DKBUILD_BASENAME=$(basename)
-$(MODULE).o: $($(MODULE)_OBJECTS)
- $(LD) -m $(MOD_LINK) -r -o $(MODULE).o $($(MODULE)_OBJECTS)
+$(MODULE).o: $($(MODULE)_OBJECTS) $($(MODULE)_DEPENDENCIES)
+ $(LD) -m $(MOD_LINK) -r -o $(MODULE)_tmp.o $($(MODULE)_OBJECTS)
+ rm -f $(MODULE)_tmp.c
+ $(LINUX)/scripts/modpost $(LINUX)/vmlinux $(MODULE)_tmp.o
+ $(COMPILE) -UKBUILD_BASENAME -DKBUILD_BASENAME=$(MODULE) -c $(MODULE)_tmp.mod.c
+ $(LD) -m $(MOD_LINK) -r -o $(MODULE).o $(MODULE)_tmp.o $(MODULE)_tmp.mod.o
else
KCFLAGS='-g -Wall -pipe -Wno-trigraphs -Wstrict-prototypes -fno-strict-aliasing -fno-common '
case ${linux25} in
yes )
- KCPPFLAGS='-D__KERNEL__ -U__i386__ -Ui386 -DUM_FASTCALL -D__arch_um__ -DSUBARCH="i386" -DNESTING=0 -D_LARGEFILE64_SOURCE -Derrno=kernel_errno -DPATCHLEVEL=4 -DMODULE -I$(LINUX)/arch/um/include -I$(LINUX)/arch/um/kernel/tt/include -I$(LINUX)/arch/um/kernel/skas/include -O2 -nostdinc -iwithprefix include -DKBUILD_BASENAME=$(MODULE) -DKBUILD_MODNAME=$(MODULE) '
+ KCPPFLAGS='-D__KERNEL__ -U__i386__ -Ui386 -DUM_FASTCALL -D__arch_um__ -DSUBARCH="i386" -DNESTING=0 -D_LARGEFILE64_SOURCE -Derrno=kernel_errno -DPATCHLEVEL=4 -DMODULE -I$(LINUX)/arch/um/include -I$(LINUX)/arch/um/kernel/tt/include -I$(LINUX)/arch/um/kernel/skas/include -O2 -nostdinc -iwithprefix include'
;;
* )
KCPPFLAGS='-D__KERNEL__ -U__i386__ -Ui386 -DUM_FASTCALL -D__arch_um__ -DSUBARCH="i386" -DNESTING=0 -D_LARGEFILE64_SOURCE -Derrno=kernel_errno -DPATCHLEVEL=4 -DMODULE -I$(LINUX)/arch/um/kernel/tt/include -I$(LINUX)/arch/um/include '
AC_MSG_CHECKING(for MODVERSIONS)
if egrep -e 'MODVERSIONS.*1' $LINUX/include/linux/autoconf.h >/dev/null 2>&1;
then
- MFLAGS="-DMODULE -DMODVERSIONS -include $LINUX/include/linux/modversions.h -DEXPORT_SYMTAB"
- AC_MSG_RESULT(yes)
- else
- MFLAGS=
- AC_MSG_RESULT(no)
+ if test $linux25 != "yes"; then
+ MFLAGS="-DMODULE -DMODVERSIONS -include $LINUX/include/linux/modversions.h -DEXPORT_SYMTAB"
+ AC_MSG_RESULT(yes)
+ fi
fi
fi
/* FIXME: Find a better method of setting IRQ affinity...
*/
- call_usermodehelper (argv[0], argv, envp);
+ USERMODEHELPER(argv[0], argv, envp);
#endif
}
#define DEBUG_SUBSYSTEM S_SOCKNAL
#include <linux/kp30.h>
+#include <linux/portals_compat25.h>
#include <portals/p30.h>
#include <portals/lib-p30.h>
#include <portals/socknal.h>
#include <sys/stat.h>
#include <sys/mman.h>
-#define BUG() /* workaround for module.h includes */
#include <linux/version.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#define BUG() /* workaround for module.h includes */
#include <linux/module.h>
#endif
return 0;
}
+static struct mod_paths {
+ char *name, *path;
+} mod_paths[] = {
+ {"portals", "lustre/portals/libcfs"},
+ {"ksocknal", "lustre/portals/knals/socknal"},
+ {"kptlrouter", "lustre/portals/router"},
+ {"lvfs", "lustre/lvfs"},
+ {"obdclass", "lustre/obdclass"},
+ {"llog_test", "lustre/obdclass"},
+ {"ptlrpc", "lustre/ptlrpc"},
+ {"obdext2", "lustre/obdext2"},
+ {"ost", "lustre/ost"},
+ {"osc", "lustre/osc"},
+ {"mds", "lustre/mds"},
+ {"mdc", "lustre/mdc"},
+ {"llite", "lustre/llite"},
+ {"obdecho", "lustre/obdecho"},
+ {"ldlm", "lustre/ldlm"},
+ {"obdfilter", "lustre/obdfilter"},
+ {"extN", "lustre/extN"},
+ {"lov", "lustre/lov"},
+ {"fsfilt_ext3", "lustre/lvfs"},
+ {"fsfilt_extN", "lustre/lvfs"},
+ {"fsfilt_reiserfs", "lustre/lvfs"},
+ {"mds_ext2", "lustre/mds"},
+ {"mds_ext3", "lustre/mds"},
+ {"mds_extN", "lustre/mds"},
+ {"ptlbd", "lustre/ptlbd"},
+ {"mgmt_svc", "lustre/mgmt"},
+ {"mgmt_cli", "lustre/mgmt"},
+ {NULL, NULL}
+};
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
int jt_dbg_modules(int argc, char **argv)
{
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
- struct mod_paths {
- char *name, *path;
- } *mp, mod_paths[] = {
- {"portals", "lustre/portals/libcfs"},
- {"ksocknal", "lustre/portals/knals/socknal"},
- {"kptlrouter", "lustre/portals/router"},
- {"lvfs", "lustre/lvfs"},
- {"obdclass", "lustre/obdclass"},
- {"llog_test", "lustre/obdclass"},
- {"ptlrpc", "lustre/ptlrpc"},
- {"obdext2", "lustre/obdext2"},
- {"ost", "lustre/ost"},
- {"osc", "lustre/osc"},
- {"mds", "lustre/mds"},
- {"mdc", "lustre/mdc"},
- {"llite", "lustre/llite"},
- {"obdecho", "lustre/obdecho"},
- {"ldlm", "lustre/ldlm"},
- {"obdfilter", "lustre/obdfilter"},
- {"extN", "lustre/extN"},
- {"lov", "lustre/lov"},
- {"fsfilt_ext3", "lustre/lvfs"},
- {"fsfilt_extN", "lustre/lvfs"},
- {"fsfilt_reiserfs", "lustre/lvfs"},
- {"mds_ext2", "lustre/mds"},
- {"mds_ext3", "lustre/mds"},
- {"mds_extN", "lustre/mds"},
- {"ptlbd", "lustre/ptlbd"},
- {"mgmt_svc", "lustre/mgmt"},
- {"mgmt_cli", "lustre/mgmt"},
- {NULL, NULL}
- };
+ struct mod_paths *mp;
char *path = "..";
char *kernel = "linux";
}
return 0;
+}
#else
- printf("jt_dbg_module is not yet implemented for Linux 2.5\n");
+int jt_dbg_modules(int argc, char **argv)
+{
+ struct mod_paths *mp;
+ char *path = "..";
+ char *kernel = "linux";
+ const char *proc = "/proc/modules";
+ char modname[128], others[128];
+ long modaddr;
+ int rc;
+ FILE *file;
+
+ if (argc >= 2)
+ path = argv[1];
+ if (argc == 3)
+ kernel = argv[2];
+ if (argc > 3) {
+ printf("%s [path] [kernel]\n", argv[0]);
+ return 0;
+ }
+
+ file = fopen(proc, "r");
+ if (!file) {
+ printf("failed open %s: %s\n", proc, strerror(errno));
+ return 0;
+ }
+
+ while ((rc = fscanf(file, "%s %s %s %s %s %lx\n",
+ modname, others, others, others, others, &modaddr)) == 6) {
+ for (mp = mod_paths; mp->name != NULL; mp++) {
+ if (!strcmp(mp->name, modname))
+ break;
+ }
+ if (mp->name) {
+ printf("add-symbol-file %s/%s/%s.o 0x%0lx\n", path,
+ mp->path, mp->name, modaddr);
+ }
+ }
+
return 0;
-#endif /* linux 2.5 */
}
+#endif /* linux 2.5 */
int jt_dbg_panic(int argc, char **argv)
{
- hold dentry reference for closed log files for unlink (2325)
- reserve space for all logs during transactions (2059)
- don't evict page beyond end of stripe extent (2925)
+ - don't oops on a deleted current working directory (2399)
+ - handle hard links to targets without a parent properly (2517)
2004-03-04 Cluster File Systems, Inc. <info@clusterfs.com>
* version 1.2.0
if LINUX25
-# We still need to link each module with vermagic.o to get rid of "kernel taited" warnings.
-basename=$(shell echo $< | sed -e 's/\.c//g' | sed -e 's/-//g' | sed -e 's/\.o//g')
+# FIXME
+# need to be rewritten:
+# - bad hacking in lvfs/Makefile.am obdclass/Makefile.am
+# - .o -> .ko
+#
+basename=$(shell echo $< | sed -e 's/\.c//g' | sed -e 's/-//g' | sed -e 's/\.o//g' | sed -e 's/^.*\///g')
AM_CPPFLAGS=-I$(top_builddir)/include -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -DKBUILD_MODNAME=$(MODULE) -DKBUILD_BASENAME=$(basename)
+$(MODULE).o: $($(MODULE)_OBJECTS) $($(MODULE)_DEPENDENCIES)
+ $(LD) -m $(MOD_LINK) -r -o $(MODULE)_tmp.o $($(MODULE)_OBJECTS)
+ rm -f $(MODULE)_tmp.c
+ $(LINUX)/scripts/modpost $(LINUX)/vmlinux $(MODULE)_tmp.o
+ $(COMPILE) -UKBUILD_BASENAME -DKBUILD_BASENAME=$(MODULE) -c $(MODULE)_tmp.mod.c
+ $(LD) -m $(MOD_LINK) -r -o $(MODULE).o $(MODULE)_tmp.o $(MODULE)_tmp.mod.o
+
else
AM_CPPFLAGS=-I$(top_builddir)/include
+$(MODULE).o: $($(MODULE)_OBJECTS) $($(MODULE)_DEPENDENCIES)
+ $(LD) -m "`$(LD) --help | awk '/supported emulations/ {print $$4}'`" -r -o $(MODULE).o $($(MODULE)_OBJECTS)
endif
-$(MODULE).o: $($(MODULE)_OBJECTS) $($(MODULE)_DEPENDENCIES)
- $(LD) -m "`$(LD) --help | awk '/supported emulations/ {print $$4}'`" -r -o $(MODULE).o $($(MODULE)_OBJECTS)
tags:
rm -f $(top_srcdir)/TAGS
current->tty = NULL;
}
+static inline int cleanup_group_info(void)
+{
+ struct group_info *ginfo;
+
+ ginfo = groups_alloc(2);
+ if (!ginfo)
+ return -ENOMEM;
+
+ ginfo->ngroups = 0;
+ set_current_groups(ginfo);
+ put_group_info(ginfo);
+
+ return 0;
+}
+
#define smp_num_cpus NR_CPUS
#ifndef conditional_schedule
current->tty = NULL;
}
+static inline int cleanup_group_info(void)
+{
+ /* Get rid of unneeded supplementary groups */
+ current->ngroups = 0;
+ memset(current->groups, 0, sizeof(current->groups));
+ return 0;
+}
+
#ifndef conditional_schedule
#define conditional_schedule() if (unlikely(need_resched())) schedule()
#endif
+ * Bruce Fields <bfields@umich.edu>
+ * Copyright (c) 2002 The Regents of the Unviersity of Michigan
+ *
-+ * $Id: linux-2.6.3-CITI_NFS4_ALL.patch,v 1.2 2004/03/17 01:04:13 nic Exp $
++ * $Id: linux-2.6.3-CITI_NFS4_ALL.patch,v 1.2.4.1 2004/03/17 23:55:23 adilger Exp $
+ *
+ */
+
modulefs_DATA = llite.o
EXTRA_PROGRAMS = llite
-llite_SOURCES = dcache.c dir.c file.c llite_close.c llite_lib.c llite_nfs.c
-llite_SOURCES += lproc_llite.c namei.c rw.c rw24.c super.c super25.c
-llite_SOURCES += symlink.c sysctl.c llite_internal.h
+COMMON_SRC = dcache.c dir.c file.c llite_close.c llite_lib.c llite_nfs.c rw.c \
+ lproc_llite.c namei.c symlink.c sysctl.c llite_internal.h
+
+if LINUX25
+llite_SOURCES = $(COMMON_SRC) rw26.c super25.c
+else
+llite_SOURCES = $(COMMON_SRC) rw24.c super.c
+endif
include $(top_srcdir)/Rules
GOTO(out_root, err);
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+#warning "Please fix this"
+#else
/* bug 2805 - set VM readahead to zero */
vm_max_readahead = vm_min_readahead = 0;
+#endif
sb->s_root = d_alloc_root(root);
RETURN(err);
writepage: ll_writepage_26,
writepages: generic_writepages,
set_page_dirty: __set_page_dirty_nobuffers,
- sync_page: ll_sync_page,
+ sync_page: NULL,
prepare_write: ll_prepare_write,
commit_write: ll_commit_write,
removepage: ll_removepage,
#include <linux/lprocfs_status.h>
#include "llite_internal.h"
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
extern struct address_space_operations ll_aops;
extern struct address_space_operations ll_dir_aops;
module_init(init_lustre_lite);
module_exit(exit_lustre_lite);
-#endif
#include <linux/lprocfs_status.h>
#include "llite_internal.h"
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
-
struct super_block * ll_get_sb(struct file_system_type *fs_type,
int flags, const char *devname, void * data)
{
module_init(init_lustre_lite);
module_exit(exit_lustre_lite);
-#endif
# This code is issued under the GNU General Public License.
# See the file COPYING in this distribution
DEFS=
-MODULE = lvfs
-
-
-if EXTN
-FSMOD = fsfilt_extN
-else
-FSMOD = fsfilt_ext3
-endif
-
if LIBLUSTRE
noinst_LIBRARIES = liblvfs.a
#endif
else
-modulefs_DATA = lvfs.o $(FSMOD).o fsfilt_reiserfs.o
-EXTRA_PROGRAMS = lvfs $(FSMOD) fsfilt_reiserfs
+MODULE = lvfs
+
+if EXTN
+FSMOD = fsfilt_extN
+else
+FSMOD = fsfilt_ext3
+endif
+
+modulefs_DATA = lvfs.o $(FSMOD).o
+
+EXTRA_PROGRAMS = lvfs $(FSMOD)
lvfs_SOURCES = lvfs_common.c lvfs_linux.c fsfilt.c lvfs_internal.h
+if EXTN
+fsfilt_extN_SOURCES = fsfilt_extN.c lvfs_internal.h
+else
+fsfilt_ext3_SOURCES = fsfilt_ext3.c lvfs_internal.h
+endif
endif
fsfilt_extN.c: fsfilt_ext3.c
sed -e "s/EXT3/EXTN/g" -e "s/ext3/extN/g" $< > $@
include $(top_srcdir)/Rules
+
+if LINUX25
+# workaround for fsfilt_ext3
+$(FSMOD).o: $(FSMOD).c
+ $(COMPILE) -UKBUILD_MODNAME -DKBUILD_MODNAME=$(FSMOD) -c -o $(FSMOD)_tmp.o $<
+ rm -f $(FSMOD)_tmp.c
+ $(LINUX)/scripts/modpost $(LINUX)/vmlinux $(FSMOD)_tmp.o
+ $(COMPILE) -UKBUILD_MODNAME -UKBUILD_BASENAME -DKBUILD_BASENAME=$(FSMOD) \
+ -c $(FSMOD)_tmp.mod.c
+ $(LD) -m "`$(LD) --help | awk '/supported emulations/ {print $$4}'`" -r \
+ -o $(FSMOD).o $(FSMOD)_tmp.o $(FSMOD)_tmp.mod.o
+endif
#define DEBUG_SUBSYSTEM S_FILTER
+#include <linux/init.h>
+#include <linux/module.h>
#include <linux/fs.h>
#include <linux/jbd.h>
#include <linux/slab.h>
#include <linux/lustre_fsfilt.h>
#include <linux/obd.h>
#include <linux/obd_class.h>
-#include <linux/module.h>
static kmem_cache_t *fcb_cache;
static atomic_t fcb_cache_count = ATOMIC_INIT(0);
# define ASSERT_KERNEL_CTXT(msg) do {} while(0)
#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+#define current_ngroups current->group_info->ngroups
+#define current_groups current->group_info->small_block
+#else
+#define current_ngroups current->ngroups
+#define current_groups current->groups
+#endif
+
/* push / pop to root of obd store */
void push_ctxt(struct obd_run_ctxt *save, struct obd_run_ctxt *new_ctx,
struct obd_ucred *uc)
LASSERT(atomic_read(&new_ctx->pwd->d_count));
save->pwd = dget(current->fs->pwd);
save->pwdmnt = mntget(current->fs->pwdmnt);
- save->ngroups = current->ngroups;
+ save->ngroups = current_ngroups;
LASSERT(save->pwd);
LASSERT(save->pwdmnt);
save->ouc.ouc_fsuid = current->fsuid;
save->ouc.ouc_fsgid = current->fsgid;
save->ouc.ouc_cap = current->cap_effective;
- save->ouc.ouc_suppgid1 = current->groups[0];
- save->ouc.ouc_suppgid2 = current->groups[1];
+ save->ouc.ouc_suppgid1 = current_groups[0];
+ save->ouc.ouc_suppgid2 = current_groups[1];
current->fsuid = uc->ouc_fsuid;
current->fsgid = uc->ouc_fsgid;
current->cap_effective = uc->ouc_cap;
- current->ngroups = 0;
+ current_ngroups = 0;
if (uc->ouc_suppgid1 != -1)
- current->groups[current->ngroups++] = uc->ouc_suppgid1;
+ current_groups[current_ngroups++] = uc->ouc_suppgid1;
if (uc->ouc_suppgid2 != -1)
- current->groups[current->ngroups++] = uc->ouc_suppgid2;
+ current_groups[current_ngroups++] = uc->ouc_suppgid2;
}
set_fs(new_ctx->fs);
set_fs_pwd(current->fs, new_ctx->pwdmnt, new_ctx->pwd);
current->fsuid = saved->ouc.ouc_fsuid;
current->fsgid = saved->ouc.ouc_fsgid;
current->cap_effective = saved->ouc.ouc_cap;
- current->ngroups = saved->ngroups;
- current->groups[0] = saved->ouc.ouc_suppgid1;
- current->groups[1] = saved->ouc.ouc_suppgid2;
+ current_ngroups = saved->ngroups;
+ current_groups[0] = saved->ouc.ouc_suppgid1;
+ current_groups[1] = saved->ouc.ouc_suppgid2;
}
/*
int rc;
ENTRY;
-
- /* Get rid of unneeded supplementary groups */
- current->ngroups = 0;
- memset(current->groups, 0, sizeof(current->groups));
+ rc = cleanup_group_info();
+ if (rc)
+ RETURN(rc);
mds->mds_vfsmnt = mnt;
mds->mds_sb = mnt->mnt_root->d_inode->i_sb;
endif
include $(top_srcdir)/Rules
+
+if LINUX25
+# workaround for llog_test
+llog_test.o: llog_test.c
+ $(COMPILE) -UKBUILD_MODNAME -DKBUILD_MODNAME=llog_test -c -o llog_test_tmp.o $<
+ rm -f llog_test_tmp.c
+ $(LINUX)/scripts/modpost $(LINUX)/vmlinux llog_test_tmp.o
+ $(COMPILE) -UKBUILD_MODNAME -UKBUILD_BASENAME -DKBUILD_BASENAME=llog_test \
+ -c llog_test_tmp.mod.c
+ $(LD) -m "`$(LD) --help | awk '/supported emulations/ {print $$4}'`" -r \
+ -o llog_test.o llog_test_tmp.o llog_test_tmp.mod.o
+endif
MODULE = obdfilter
modulefs_DATA = obdfilter.o
EXTRA_PROGRAMS = obdfilter
-obdfilter_SOURCES = filter.c filter_io.c filter_log.c filter_san.c \
- filter_io_24.c lproc_obdfilter.c filter_internal.h filter_lvb.c
+
+COMMON_SRC = filter.c filter_io.c filter_log.c filter_san.c lproc_obdfilter.c \
+ filter_internal.h filter_lvb.c
+
+if LINUX25
+obdfilter_SOURCES = $(COMMON_SRC) filter_io_26.c
+else
+obdfilter_SOURCES = $(COMMON_SRC) filter_io_24.c
+endif
include $(top_srcdir)/Rules
* avoid overgranting in face of multiple RPCs in flight). This
* essentially will be able to control the OSC_MAX_RIF for a client.
*
- * If we do have a large disparity and multiple RPCs in flight we
- * might grant "too much" but that's OK because it means we are
- * dirtying a lot on the client and will likely use it up quickly. */
+ * If we do have a large disparity between what the client thinks it
+ * has and what we think it has, don't grant very much and let the
+ * client consume its grant first. Either it just has lots of RPCs
+ * in flight, or it was evicted and its grants will soon be used up. */
if (current_grant < want) {
+ if (current_grant > fed->fed_grant + FILTER_GRANT_CHUNK)
+ want = 65536;
grant = min((want >> blockbits) / 2,
(fs_space_left >> blockbits) / 8);
grant <<= blockbits;
#include <linux/pagemap.h> // XXX kill me soon
#include <linux/version.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-
#define DEBUG_SUBSYSTEM S_FILTER
#include <linux/iobuf.h>
RETURN(rc);
}
-
-#endif
-
int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, int objcount,
struct obd_ioobj *obj, int niocount,
- struct niobuf_local *res, struct obd_trans_info *oti)
+ struct niobuf_local *res, struct obd_trans_info *oti,
+ int rc)
{
struct obd_device *obd = exp->exp_obd;
struct obd_run_ctxt saved;
struct fsfilt_objinfo fso;
struct iattr iattr = { .ia_valid = ATTR_SIZE, .ia_size = 0, };
struct inode *inode = NULL;
- int rc = 0, i, k, cleanup_phase = 0, err;
+ int i, k, cleanup_phase = 0, err;
unsigned long now = jiffies; /* DEBUGGING OST TIMEOUTS */
int blocks_per_page;
struct dio_request *dreq;
LASSERT(objcount == 1);
LASSERT(current->journal_info == NULL);
+ if (rc != 0)
+ GOTO(cleanup, rc);
+
inode = res->dentry->d_inode;
blocks_per_page = PAGE_SIZE >> inode->i_blkbits;
LASSERT(blocks_per_page <= MAX_BLOCKS_PER_PAGE);
int rc;
ENTRY;
- /* Get rid of unneeded supplementary groups */
- current->ngroups = 0;
- memset(current->groups, 0, sizeof(current->groups));
+ rc = cleanup_group_info();
+ if (rc)
+ RETURN(rc);
rc = llog_start_commit_thread();
if (rc < 0)
if LINUX25
-basename=$(shell echo $< | sed -e 's/\.c//g' | sed -e 's/-//g' | sed -e 's/\.o//g')
+basename=$(shell echo $< | sed -e 's/\.c//g' | sed -e 's/-//g' | sed -e 's/\.o//g' | sed -e 's/^.*\///g')
AM_CPPFLAGS= -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -DKBUILD_MODNAME=$(MODULE) -DKBUILD_BASENAME=$(basename)
-$(MODULE).o: $($(MODULE)_OBJECTS)
- $(LD) -m $(MOD_LINK) -r -o $(MODULE).o $($(MODULE)_OBJECTS)
+$(MODULE).o: $($(MODULE)_OBJECTS) $($(MODULE)_DEPENDENCIES)
+ $(LD) -m $(MOD_LINK) -r -o $(MODULE)_tmp.o $($(MODULE)_OBJECTS)
+ rm -f $(MODULE)_tmp.c
+ $(LINUX)/scripts/modpost $(LINUX)/vmlinux $(MODULE)_tmp.o
+ $(COMPILE) -UKBUILD_BASENAME -DKBUILD_BASENAME=$(MODULE) -c $(MODULE)_tmp.mod.c
+ $(LD) -m $(MOD_LINK) -r -o $(MODULE).o $(MODULE)_tmp.o $(MODULE)_tmp.mod.o
else
KCFLAGS='-g -Wall -pipe -Wno-trigraphs -Wstrict-prototypes -fno-strict-aliasing -fno-common '
case ${linux25} in
yes )
- KCPPFLAGS='-D__KERNEL__ -U__i386__ -Ui386 -DUM_FASTCALL -D__arch_um__ -DSUBARCH="i386" -DNESTING=0 -D_LARGEFILE64_SOURCE -Derrno=kernel_errno -DPATCHLEVEL=4 -DMODULE -I$(LINUX)/arch/um/include -I$(LINUX)/arch/um/kernel/tt/include -I$(LINUX)/arch/um/kernel/skas/include -O2 -nostdinc -iwithprefix include -DKBUILD_BASENAME=$(MODULE) -DKBUILD_MODNAME=$(MODULE) '
+ KCPPFLAGS='-D__KERNEL__ -U__i386__ -Ui386 -DUM_FASTCALL -D__arch_um__ -DSUBARCH="i386" -DNESTING=0 -D_LARGEFILE64_SOURCE -Derrno=kernel_errno -DPATCHLEVEL=4 -DMODULE -I$(LINUX)/arch/um/include -I$(LINUX)/arch/um/kernel/tt/include -I$(LINUX)/arch/um/kernel/skas/include -O2 -nostdinc -iwithprefix include'
;;
* )
KCPPFLAGS='-D__KERNEL__ -U__i386__ -Ui386 -DUM_FASTCALL -D__arch_um__ -DSUBARCH="i386" -DNESTING=0 -D_LARGEFILE64_SOURCE -Derrno=kernel_errno -DPATCHLEVEL=4 -DMODULE -I$(LINUX)/arch/um/kernel/tt/include -I$(LINUX)/arch/um/include '
AC_MSG_CHECKING(for MODVERSIONS)
if egrep -e 'MODVERSIONS.*1' $LINUX/include/linux/autoconf.h >/dev/null 2>&1;
then
- MFLAGS="-DMODULE -DMODVERSIONS -include $LINUX/include/linux/modversions.h -DEXPORT_SYMTAB"
- AC_MSG_RESULT(yes)
- else
- MFLAGS=
- AC_MSG_RESULT(no)
+ if test $linux25 != "yes"; then
+ MFLAGS="-DMODULE -DMODVERSIONS -include $LINUX/include/linux/modversions.h -DEXPORT_SYMTAB"
+ AC_MSG_RESULT(yes)
+ fi
fi
fi
/* FIXME: Find a better method of setting IRQ affinity...
*/
- call_usermodehelper (argv[0], argv, envp);
+ USERMODEHELPER(argv[0], argv, envp);
#endif
}
#define DEBUG_SUBSYSTEM S_SOCKNAL
#include <linux/kp30.h>
+#include <linux/portals_compat25.h>
#include <portals/p30.h>
#include <portals/lib-p30.h>
#include <portals/socknal.h>
#include <sys/stat.h>
#include <sys/mman.h>
-#define BUG() /* workaround for module.h includes */
#include <linux/version.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+#define BUG() /* workaround for module.h includes */
#include <linux/module.h>
#endif
return 0;
}
+static struct mod_paths {
+ char *name, *path;
+} mod_paths[] = {
+ {"portals", "lustre/portals/libcfs"},
+ {"ksocknal", "lustre/portals/knals/socknal"},
+ {"kptlrouter", "lustre/portals/router"},
+ {"lvfs", "lustre/lvfs"},
+ {"obdclass", "lustre/obdclass"},
+ {"llog_test", "lustre/obdclass"},
+ {"ptlrpc", "lustre/ptlrpc"},
+ {"obdext2", "lustre/obdext2"},
+ {"ost", "lustre/ost"},
+ {"osc", "lustre/osc"},
+ {"mds", "lustre/mds"},
+ {"mdc", "lustre/mdc"},
+ {"llite", "lustre/llite"},
+ {"obdecho", "lustre/obdecho"},
+ {"ldlm", "lustre/ldlm"},
+ {"obdfilter", "lustre/obdfilter"},
+ {"extN", "lustre/extN"},
+ {"lov", "lustre/lov"},
+ {"fsfilt_ext3", "lustre/lvfs"},
+ {"fsfilt_extN", "lustre/lvfs"},
+ {"fsfilt_reiserfs", "lustre/lvfs"},
+ {"mds_ext2", "lustre/mds"},
+ {"mds_ext3", "lustre/mds"},
+ {"mds_extN", "lustre/mds"},
+ {"ptlbd", "lustre/ptlbd"},
+ {"mgmt_svc", "lustre/mgmt"},
+ {"mgmt_cli", "lustre/mgmt"},
+ {NULL, NULL}
+};
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
int jt_dbg_modules(int argc, char **argv)
{
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
- struct mod_paths {
- char *name, *path;
- } *mp, mod_paths[] = {
- {"portals", "lustre/portals/libcfs"},
- {"ksocknal", "lustre/portals/knals/socknal"},
- {"kptlrouter", "lustre/portals/router"},
- {"lvfs", "lustre/lvfs"},
- {"obdclass", "lustre/obdclass"},
- {"llog_test", "lustre/obdclass"},
- {"ptlrpc", "lustre/ptlrpc"},
- {"obdext2", "lustre/obdext2"},
- {"ost", "lustre/ost"},
- {"osc", "lustre/osc"},
- {"mds", "lustre/mds"},
- {"mdc", "lustre/mdc"},
- {"llite", "lustre/llite"},
- {"obdecho", "lustre/obdecho"},
- {"ldlm", "lustre/ldlm"},
- {"obdfilter", "lustre/obdfilter"},
- {"extN", "lustre/extN"},
- {"lov", "lustre/lov"},
- {"fsfilt_ext3", "lustre/lvfs"},
- {"fsfilt_extN", "lustre/lvfs"},
- {"fsfilt_reiserfs", "lustre/lvfs"},
- {"mds_ext2", "lustre/mds"},
- {"mds_ext3", "lustre/mds"},
- {"mds_extN", "lustre/mds"},
- {"ptlbd", "lustre/ptlbd"},
- {"mgmt_svc", "lustre/mgmt"},
- {"mgmt_cli", "lustre/mgmt"},
- {NULL, NULL}
- };
+ struct mod_paths *mp;
char *path = "..";
char *kernel = "linux";
}
return 0;
+}
#else
- printf("jt_dbg_module is not yet implemented for Linux 2.5\n");
+int jt_dbg_modules(int argc, char **argv)
+{
+ struct mod_paths *mp;
+ char *path = "..";
+ char *kernel = "linux";
+ const char *proc = "/proc/modules";
+ char modname[128], others[128];
+ long modaddr;
+ int rc;
+ FILE *file;
+
+ if (argc >= 2)
+ path = argv[1];
+ if (argc == 3)
+ kernel = argv[2];
+ if (argc > 3) {
+ printf("%s [path] [kernel]\n", argv[0]);
+ return 0;
+ }
+
+ file = fopen(proc, "r");
+ if (!file) {
+ printf("failed open %s: %s\n", proc, strerror(errno));
+ return 0;
+ }
+
+ while ((rc = fscanf(file, "%s %s %s %s %s %lx\n",
+ modname, others, others, others, others, &modaddr)) == 6) {
+ for (mp = mod_paths; mp->name != NULL; mp++) {
+ if (!strcmp(mp->name, modname))
+ break;
+ }
+ if (mp->name) {
+ printf("add-symbol-file %s/%s/%s.o 0x%0lx\n", path,
+ mp->path, mp->name, modaddr);
+ }
+ }
+
return 0;
-#endif /* linux 2.5 */
}
+#endif /* linux 2.5 */
int jt_dbg_panic(int argc, char **argv)
{
spin_lock_irqsave(&imp->imp_lock, flags);
if (imp->imp_state != LUSTRE_IMP_DISCON) {
in_recovery = 1;
- }
+ }
spin_unlock_irqrestore(&imp->imp_lock, flags);
if (in_recovery == 1)
RETURN(-EALREADY);
-
rc = ptlrpc_connect_import(imp, new_uuid);
if (rc)
RETURN(rc);
- CDEBUG(D_ERROR, "%s: recovery started, waiting\n",
+ CDEBUG(D_ERROR, "%s: recovery started, waiting\n",
imp->imp_target_uuid.uuid);
lwi = LWI_TIMEOUT(MAX(obd_timeout * HZ, 1), NULL, NULL);
- rc = l_wait_event(imp->imp_recovery_waitq,
+ rc = l_wait_event(imp->imp_recovery_waitq,
!ptlrpc_import_in_recovery(imp), &lwi);
- CDEBUG(D_ERROR, "%s: recovery finished\n",
+ CDEBUG(D_ERROR, "%s: recovery finished\n",
imp->imp_target_uuid.uuid);
RETURN(rc);
-
}
void ptlrpc_fail_export(struct obd_export *exp)
#!/bin/sh -e
CONFLICTS=cvs-merge-conflicts
-CVS=cvs
+CVS="cvs -z3"
if [ -f .mergeinfo ] ; then
echo ".mergeinfo exists - clean up first"