config.log
config.status
configure
+.*.o.cmd
-EXTRA_CFLAGS= -Ifs/lustre/include -Ifs/lustre/portals/include
+EXTRA_CFLAGS := -Ifs/lustre/include -Ifs/lustre/portals/include
+# portals/utils/debug.c wants <linux/version.h> from userspace. sigh.
+HOSTCFLAGS := -I@LINUX@/include $(EXTRA_CFLAGS)
+LIBREADLINE := @LIBREADLINE@
+# 2.5's makefiles aren't nice to cross dir libraries in host programs
+PTLCTLOBJS := debug.o l_ioctl.o parser.o portals.o
-EXTRA_CFLAGS= -Ifs/lustre/include -Ifs/lustre/portals/include
+EXTRA_CFLAGS := -Ifs/lustre/include -Ifs/lustre/portals/include
+HOSTCFLAGS := $(EXTRA_CFLAGS)
+# the kernel doesn't want us to build archives for host binaries :/
+PTLCTLOBJS := debug.o l_ioctl.o parser.o portals.o
-include fs/lustre/portals/Kernelenv
+include $(src)/Kernelenv
-obj-y += portals/
+# The ordering of these determines the order that each subsystem's
+# module_init() functions are called in. if these are changed make sure
+# they reflect the dependencies between each subsystem's _init functions.
obj-y += libcfs/
-obj-y += knals/
+obj-y += portals/
obj-y += router/
+obj-y += knals/
+obj-y += tests/
+
+obj-m += utils/
AC_ARG_WITH(linux, [ --with-linux=[path] set path to Linux source (default=/usr/src/linux)],LINUX=$with_linux,LINUX=/usr/src/linux)
AC_SUBST(LINUX)
+if test x$enable_inkernel = xyes ; then
+ echo ln -s `pwd` $LINUX/fs/lustre
+ rm $LINUX/fs/lustre
+ ln -s `pwd` $LINUX/fs/lustre
+fi
-# --------- UML? --------------------
+# --------------------
AC_MSG_CHECKING(if you are running user mode linux for $host_cpu ...)
if test $host_cpu = "lib" ; then
host_cpu="lib"
MOD_LINK=elf64_ia64
;;
+ x86_64 )
+ AC_MSG_RESULT($host_cpu)
+ KCFLAGS='-g -O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fomit-frame-pointer -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -finline-limit=2000 -fno-strength-reduce -fno-asynchronous-unwind-tables'
+ KCPPFLAGS='-D__KERNEL__ -DMODULE'
+ MOD_LINK=elf_x86_64
+;;
+
sparc64 )
AC_MSG_RESULT($host_cpu)
KCFLAGS='-O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -Wno-unused -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare -Wa,--undeclared-regs'
#define LOWEST_BIT_SET(x) ((x) & ~((x) - 1))
-#ifndef CONFIG_SMP
-# define smp_processor_id() 0
-#endif
-
/*
* Debugging
*/
#define D_RPCTRACE (1 << 20) /* for distributed debugging */
#define D_VFSTRACE (1 << 21)
-#ifndef __KERNEL__
-#define THREAD_SIZE 8192
+#ifdef __KERNEL__
+# include <linux/sched.h> /* THREAD_SIZE */
+#else
+# define THREAD_SIZE 8192
#endif
-#ifdef __ia64__
-#define CDEBUG_STACK() (THREAD_SIZE - \
+
+#ifdef __KERNEL__
+# ifdef __ia64__
+# define CDEBUG_STACK (THREAD_SIZE - \
((unsigned long)__builtin_dwarf_cfa() & \
(THREAD_SIZE - 1)))
-#else
-#define CDEBUG_STACK() (THREAD_SIZE - \
+# else
+# define CDEBUG_STACK (THREAD_SIZE - \
((unsigned long)__builtin_frame_address(0) & \
(THREAD_SIZE - 1)))
-#endif
+# endif
-#ifdef __KERNEL__
#define CHECK_STACK(stack) \
do { \
if ((stack) > 3*THREAD_SIZE/4 && (stack) > portal_stack) { \
/*panic("LBUG");*/ \
} \
} while (0)
-#else
+#else /* __KERNEL __ */
#define CHECK_STACK(stack) do { } while(0)
-#endif
+#define CDEBUG_STACK (0L)
+#endif /* __KERNEL__ */
#if 1
#define CDEBUG(mask, format, a...) \
do { \
- CHECK_STACK(CDEBUG_STACK()); \
+ CHECK_STACK(CDEBUG_STACK); \
if (!(mask) || ((mask) & (D_ERROR | D_EMERG)) || \
(portal_debug & (mask) && \
portal_subsystem_debug & (1 << (DEBUG_SUBSYSTEM >> 24)))) \
portals_debug_msg(DEBUG_SUBSYSTEM, mask, \
__FILE__, __FUNCTION__, __LINE__, \
- CDEBUG_STACK(), format, ## a); \
+ CDEBUG_STACK, format, ## a); \
} while (0)
#define CWARN(format, a...) CDEBUG(D_WARNING, format, ## a)
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) */
#ifdef PORTAL_DEBUG
-extern void kportal_assertion_failed(char *expr,char *file,char *func,int line);
+extern void kportal_assertion_failed(char *expr, char *file, const char *func,
+ const int line);
#define LASSERT(e) ((e) ? 0 : kportal_assertion_failed( #e , __FILE__, \
__FUNCTION__, __LINE__))
#else
#endif /* PORTALS_PROFILING */
/* debug.c */
-void portals_run_lbug_upcall(char * file, char *fn, int line);
+void portals_run_lbug_upcall(char * file, const char *fn, const int line);
void portals_debug_dumplog(void);
int portals_debug_init(unsigned long bufsize);
int portals_debug_cleanup(void);
# warning printf has been defined as a macro...
# undef printf
#endif
-void portals_debug_msg (int subsys, int mask, char *file, char *fn, int line,
- unsigned long stack, const char *format, ...)
+void portals_debug_msg(int subsys, int mask, char *file, const char *fn,
+ const int line, unsigned long stack,
+ const char *format, ...)
__attribute__ ((format (printf, 7, 8)));
#else
-void portals_debug_msg (int subsys, int mask, char *file, char *fn,
- int line, unsigned long stack,
+void portals_debug_msg (int subsys, int mask, char *file, const char *fn,
+ const int line, unsigned long stack,
const char *format, ...);
#endif /* __GNUC__ */
void portals_debug_set_level(unsigned int debug_level);
Makefile
Makefile.in
+.*.o.cmd
-include ../Kernelenv
+include $(obj)/../Kernelenv
obj-y = socknal/
-# more coming...
\ No newline at end of file
+# more coming...
return &kgmnal_api;
}
-static void __exit
+static void /*__exit*/
kgmnal_finalize(void)
{
struct list_head *tmp;
/* Called by kernel at module unload time */
-static void __exit
+static void /*__exit*/
kscimacnal_finalize(void)
{
/* FIXME: How should the shutdown procedure really look? */
}
-void __exit
+void /*__exit*/
ktoenal_module_fini (void)
{
CDEBUG(D_MALLOC, "before NAL cleanup: kmem %d\n",
spin_lock_irqsave (&ktoenal_data.ksnd_sched_lock, *irq_flags);
goto get_fmb; /* => go get a fwd msg buffer */
default:
+ break;
}
/* Not Reached */
LBUG ();
goto out; /* (later) */
default:
+ break;
}
/* Not Reached */
Makefile
Makefile.in
link-stamp
+.*.o.cmd
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
/* 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;
portal_debug = debug_level;
}
-void portals_run_lbug_upcall(char * file, char *fn, int line)
+void portals_run_lbug_upcall(char *file, const char *fn, const int line)
{
char *argv[6];
char *envp[3];
argv[0] = portals_upcall;
argv[1] = "LBUG";
argv[2] = file;
- argv[3] = fn;
+ argv[3] = (char *)fn;
argv[4] = buf;
argv[5] = NULL;
struct semaphore nal_cmd_sem;
#ifdef PORTAL_DEBUG
-void
-kportal_assertion_failed (char *expr, char *file, char *func, int line)
+void kportal_assertion_failed(char *expr, char *file, const char *func,
+ const int line)
{
- portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK(),
+ portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK,
"ASSERTION(%s) failed\n", expr);
LBUG_WITH_LOC(file, func, line);
}
.deps
Makefile
Makefile.in
+.*.o.cmd
# This code is issued under the GNU General Public License.
# See the file COPYING in this distribution
-include ../Kernelenv
+include $(src)/../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
.deps
Makefile
Makefile.in
+.*.o.cmd
# This code is issued under the GNU General Public License.
# See the file COPYING in this distribution
-include ../Kernelenv
+include $(src)/../Kernelenv
obj-y += kptlrouter.o
kptlrouter-objs := router.o proc.o
#include "router.h"
-struct list_head kpr_routes;
-struct list_head kpr_nals;
+LIST_HEAD(kpr_routes);
+LIST_HEAD(kpr_nals);
unsigned long long kpr_fwd_bytes;
unsigned long kpr_fwd_packets;
*
* Once in a blue moon we register/deregister NALs and add/remove routing
* entries (thread context only)... */
-rwlock_t kpr_rwlock;
+rwlock_t kpr_rwlock = RW_LOCK_UNLOCKED;
kpr_router_interface_t kpr_router_interface = {
kprri_register: kpr_register_nal,
int
kpr_register_nal (kpr_nal_interface_t *nalif, void **argp)
{
- long flags;
+ unsigned long flags;
struct list_head *e;
kpr_nal_entry_t *ne;
void
kpr_shutdown_nal (void *arg)
{
- long flags;
+ unsigned long flags;
kpr_nal_entry_t *ne = (kpr_nal_entry_t *)arg;
CDEBUG (D_OTHER, "Shutting down NAL %d\n", ne->kpne_interface.kprni_nalid);
void
kpr_deregister_nal (void *arg)
{
- long flags;
+ unsigned long flags;
kpr_nal_entry_t *ne = (kpr_nal_entry_t *)arg;
CDEBUG (D_OTHER, "Deregister NAL %d\n", ne->kpne_interface.kprni_nalid);
kpr_add_route (int gateway_nalid, ptl_nid_t gateway_nid, ptl_nid_t lo_nid,
ptl_nid_t hi_nid)
{
- long flags;
+ unsigned long flags;
struct list_head *e;
kpr_route_entry_t *re;
int
kpr_del_route (ptl_nid_t nid)
{
- long flags;
+ unsigned long flags;
struct list_head *e;
CDEBUG(D_OTHER, "Del route "LPX64"\n", nid);
return (-ENOENT);
}
-static void __exit
+static void /*__exit*/
kpr_finalise (void)
{
LASSERT (list_empty (&kpr_nals));
CDEBUG(D_MALLOC, "kpr_initialise: kmem %d\n",
atomic_read(&portal_kmemory));
- rwlock_init(&kpr_rwlock);
- INIT_LIST_HEAD(&kpr_routes);
- INIT_LIST_HEAD(&kpr_nals);
-
kpr_proc_init();
PORTAL_SYMBOL_REGISTER(kpr_router_interface);
Makefile
Makefile.in
.deps
+.*.o.cmd
/* called by the portals_ioctl for ping requests */
-static int kping_client(struct portal_ioctl_data *args)
+int kping_client(struct portal_ioctl_data *args)
{
PORTAL_ALLOC (client, sizeof(struct pingcli_data));
if (client == NULL)
} /* pingcli_init() */
-static void __exit pingcli_cleanup(void)
+static void /*__exit*/ pingcli_cleanup(void)
{
PORTAL_SYMBOL_UNREGISTER (kping_client);
} /* pingcli_cleanup() */
#include <asm/semaphore.h>
#define STDSIZE (sizeof(int) + sizeof(int) + sizeof(struct timeval))
-#define MAXSIZE (16*1024*1024)
+#define MAXSIZE (16*1024)
static unsigned ping_head_magic;
static unsigned ping_bulk_magic;
-static int nal = 0; // Your NAL,
+static int nal = SOCKNAL; // Your NAL,
static unsigned long packets_valid = 0; // Valid packets
static int running = 1;
atomic_t pkt;
} /* pingsrv_init() */
-static void __exit pingsrv_cleanup(void)
+static void /*__exit*/ pingsrv_cleanup(void)
{
remove_proc_entry ("net/pingsrv", NULL);
/* called by the portals_ioctl for ping requests */
-static int kping_client(struct portal_ioctl_data *args)
+int kping_client(struct portal_ioctl_data *args)
{
PORTAL_ALLOC (client, sizeof(struct pingcli_data));
} /* pingcli_init() */
-static void __exit pingcli_cleanup(void)
+static void /*__exit*/ pingcli_cleanup(void)
{
PORTAL_SYMBOL_UNREGISTER (kping_client);
} /* pingcli_cleanup() */
} /* pingsrv_init() */
-static void __exit pingsrv_cleanup(void)
+static void /*__exit*/ pingsrv_cleanup(void)
{
remove_proc_entry ("net/pingsrv", NULL);
/* 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;
/* 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;
-include fs/lustre/portals/Kernelenv
+include $(src)/portals/Kernelenv
+
+# for scripts/version_tag.pl
+LINUX = @LINUX@
obj-y += portals/
+# obdclass has to come before anything that does class_register..
+obj-y += obdclass/
+obj-y += ptlrpc/
+obj-y += ldlm/
+obj-y += obdfilter/
+obj-y += mdc/
obj-y += mds/
+obj-y += obdecho/
+obj-y += osc/
+obj-y += ost/
+obj-y += lov/
+obj-y += llite/
+
+# portals needs to be before utils/, which pulls in ptlctl objects
+obj-m += utils/
+obj-m += tests/
-
-
-
drivers/block/blkpg.c | 35 +++++++++++++++++++++++++++++++++++
drivers/block/loop.c | 3 +++
- drivers/ide/ide-disk.c | 5 ++++-
- 3 files changed, 42 insertions(+), 1 deletion(-)
+ drivers/ide/ide-disk.c | 5 +++++
+ 3 files changed, 43 insertions(+)
---- rh-2.4.20/drivers/block/blkpg.c~dev_read_only_2.4.20 2003-04-11 14:05:03.000000000 +0800
-+++ rh-2.4.20-root/drivers/block/blkpg.c 2003-04-12 13:11:31.000000000 +0800
+--- kernel-2.4.20-6chaos_18_7/drivers/block/blkpg.c~dev_read_only_2.4.20-rh 2003-05-15 21:12:48.000000000 -0600
++++ kernel-2.4.20-6chaos_18_7-braam/drivers/block/blkpg.c 2003-07-12 15:10:31.000000000 -0600
@@ -297,3 +297,38 @@ int blk_ioctl(kdev_t dev, unsigned int c
}
+EXPORT_SYMBOL(dev_set_rdonly);
+EXPORT_SYMBOL(dev_check_rdonly);
+EXPORT_SYMBOL(dev_clear_rdonly);
---- rh-2.4.20/drivers/block/loop.c~dev_read_only_2.4.20 2003-04-11 14:05:08.000000000 +0800
-+++ rh-2.4.20-root/drivers/block/loop.c 2003-04-12 13:11:31.000000000 +0800
+--- kernel-2.4.20-6chaos_18_7/drivers/block/loop.c~dev_read_only_2.4.20-rh 2003-05-15 21:12:50.000000000 -0600
++++ kernel-2.4.20-6chaos_18_7-braam/drivers/block/loop.c 2003-07-12 15:10:31.000000000 -0600
@@ -491,6 +491,9 @@ static int loop_make_request(request_que
spin_unlock_irq(&lo->lo_lock);
if (lo->lo_flags & LO_FLAGS_READ_ONLY)
goto err;
} else if (rw == READA) {
---- rh-2.4.20/drivers/ide/ide-disk.c~dev_read_only_2.4.20 2003-04-11 14:04:53.000000000 +0800
-+++ rh-2.4.20-root/drivers/ide/ide-disk.c 2003-04-12 13:14:48.000000000 +0800
-@@ -381,7 +381,10 @@ static ide_startstop_t do_rw_disk (ide_d
- if (IS_PDC4030_DRIVE)
- return promise_rw_disk(drive, rq, block);
- #endif /* CONFIG_BLK_DEV_PDC4030 */
--
-+ if (rq->cmd == WRITE && dev_check_rdonly(rq->rq_dev)) {
-+ ide_end_request(1, HWGROUP(drive));
-+ return ide_stopped;
-+ }
+--- kernel-2.4.20-6chaos_18_7/drivers/ide/ide-disk.c~dev_read_only_2.4.20-rh 2003-05-15 21:13:09.000000000 -0600
++++ kernel-2.4.20-6chaos_18_7-braam/drivers/ide/ide-disk.c 2003-07-12 15:12:03.000000000 -0600
+@@ -371,6 +371,11 @@ ide_startstop_t __ide_do_rw_disk (ide_dr
+ if (driver_blocked)
+ panic("Request while ide driver is blocked?");
+
++ if (rq->cmd == WRITE && dev_check_rdonly(rq->rq_dev)) {
++ ide_end_request(1, HWGROUP(drive));
++ return ide_stopped;
++ }
++
if (IDE_CONTROL_REG)
hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
fs/open.c | 122 ++++++++++++++--
fs/proc/base.c | 3
fs/stat.c | 27 ++-
- include/linux/dcache.h | 53 +++++++
+ include/linux/dcache.h | 54 +++++++
include/linux/fs.h | 31 ++++
kernel/exit.c | 3
kernel/fork.c | 3
kernel/ksyms.c | 1
- 12 files changed, 563 insertions(+), 99 deletions(-)
+ 12 files changed, 564 insertions(+), 99 deletions(-)
---- linux-2.4.18-p4smp/fs/exec.c~vfs_intent-2.4.18-18-chaos65 2003-07-08 14:41:38.000000000 -0600
-+++ linux-2.4.18-p4smp-braam/fs/exec.c 2003-07-08 14:45:17.000000000 -0600
+--- linux-2.4.18-p4smp/fs/exec.c~vfs_intent-2.4.18-18-chaos65 2003-07-09 12:17:30.000000000 -0600
++++ linux-2.4.18-p4smp-braam/fs/exec.c 2003-07-09 13:20:37.000000000 -0600
@@ -117,8 +117,9 @@ asmlinkage long sys_uselib(const char *
struct file * file;
struct nameidata nd;
if (!err) {
- file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
+ file = dentry_open_it(nd.dentry, nd.mnt, O_RDONLY, &it);
-+ intent_release(&it);
++ intent_release(&it);
if (!IS_ERR(file)) {
err = deny_write_access(file);
if (err) {
return file;
}
}
-+ intent_release(&it);
++ intent_release(&it);
path_release(&nd);
}
goto out;
goto close_fail;
retval = binfmt->core_dump(signr, regs, file);
---- linux-2.4.18-p4smp/fs/dcache.c~vfs_intent-2.4.18-18-chaos65 2003-07-08 14:41:38.000000000 -0600
-+++ linux-2.4.18-p4smp-braam/fs/dcache.c 2003-07-08 14:45:17.000000000 -0600
+--- linux-2.4.18-p4smp/fs/dcache.c~vfs_intent-2.4.18-18-chaos65 2003-07-09 12:17:30.000000000 -0600
++++ linux-2.4.18-p4smp-braam/fs/dcache.c 2003-07-09 13:20:37.000000000 -0600
@@ -186,6 +186,13 @@ int d_invalidate(struct dentry * dentry)
spin_unlock(&dcache_lock);
return 0;
#define do_switch(x,y) do { \
--- linux-2.4.18-p4smp/fs/namespace.c~vfs_intent-2.4.18-18-chaos65 2002-06-25 22:16:14.000000000 -0600
-+++ linux-2.4.18-p4smp-braam/fs/namespace.c 2003-07-08 14:45:17.000000000 -0600
++++ linux-2.4.18-p4smp-braam/fs/namespace.c 2003-07-09 13:20:37.000000000 -0600
@@ -99,6 +99,7 @@ static void detach_mnt(struct vfsmount *
{
old_nd->dentry = mnt->mnt_mountpoint;
old_nd->mnt = mnt->mnt_parent;
-+ UNPIN(old_nd->dentry, old_nd->mnt, 1);
++ UNPIN(old_nd->dentry, old_nd->mnt, 1);
mnt->mnt_parent = mnt;
mnt->mnt_mountpoint = mnt->mnt_root;
list_del_init(&mnt->mnt_child);
{
mnt->mnt_parent = mntget(nd->mnt);
mnt->mnt_mountpoint = dget(nd->dentry);
-+ PIN(nd->dentry, nd->mnt, 1);
++ PIN(nd->dentry, nd->mnt, 1);
list_add(&mnt->mnt_hash, mount_hashtable+hash(nd->mnt, nd->dentry));
list_add(&mnt->mnt_child, &nd->mnt->mnt_mounts);
nd->dentry->d_mounted++;
{
struct nameidata old_nd;
struct vfsmount *mnt = NULL;
-+ struct lookup_intent it = { .it_op = IT_GETATTR };
++ struct lookup_intent it = { .it_op = IT_GETATTR };
int err = mount_is_safe(nd);
if (err)
return err;
- err = path_lookup(old_name, LOOKUP_POSITIVE|LOOKUP_FOLLOW, &old_nd);
- if (err)
+ err = path_lookup_it(old_name, LOOKUP_POSITIVE|LOOKUP_FOLLOW, &old_nd, &it);
-+ if (err) {
-+ intent_release(&it);
++ if (err) {
++ intent_release(&it);
return err;
-+ }
++ }
down_write(¤t->namespace->sem);
err = -EINVAL;
}
up_write(¤t->namespace->sem);
-+ intent_release(&it);
++ intent_release(&it);
path_release(&old_nd);
return err;
}
{
struct nameidata nd;
- int retval = 0;
-+ struct lookup_intent it = { .it_op = IT_GETATTR };
-+ int retval = 0;
++ struct lookup_intent it = { .it_op = IT_GETATTR };
++ int retval = 0;
int mnt_flags = 0;
/* Discard magic */
- retval = path_lookup(dir_name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, &nd);
- if (retval)
+ retval = path_lookup_it(dir_name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, &nd, &it);
-+ if (retval) {
-+ intent_release(&it);
++ if (retval) {
++ intent_release(&it);
return retval;
-
-+ }
++ }
if (flags & MS_REMOUNT)
retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags,
data_page);
retval = do_add_mount(&nd, type_page, flags, mnt_flags,
dev_name, data_page);
+
-+ intent_release(&it);
++ intent_release(&it);
path_release(&nd);
return retval;
}
{
struct vfsmount *tmp;
struct nameidata new_nd, old_nd, parent_nd, root_parent, user_nd;
-+ struct lookup_intent new_it = { .it_op = IT_GETATTR };
-+ struct lookup_intent old_it = { .it_op = IT_GETATTR };
++ struct lookup_intent new_it = { .it_op = IT_GETATTR };
++ struct lookup_intent old_it = { .it_op = IT_GETATTR };
int error;
if (!capable(CAP_SYS_ADMIN))
up(&old_nd.dentry->d_inode->i_zombie);
up_write(¤t->namespace->sem);
path_release(&user_nd);
-+ intent_release(&old_it);
++ intent_release(&old_it);
path_release(&old_nd);
out1:
-+ intent_release(&new_it);
++ intent_release(&new_it);
path_release(&new_nd);
out0:
unlock_kernel();
---- linux-2.4.18-p4smp/fs/namei.c~vfs_intent-2.4.18-18-chaos65 2003-07-08 14:41:38.000000000 -0600
-+++ linux-2.4.18-p4smp-braam/fs/namei.c 2003-07-08 14:45:17.000000000 -0600
+--- linux-2.4.18-p4smp/fs/namei.c~vfs_intent-2.4.18-18-chaos65 2003-07-09 12:17:30.000000000 -0600
++++ linux-2.4.18-p4smp-braam/fs/namei.c 2003-07-09 13:20:37.000000000 -0600
@@ -94,6 +94,13 @@
* XEmacs seems to be relying on it...
*/
+ err = dentry->d_inode->i_op->follow_link2(dentry, nd, it);
+ else
+ err = dentry->d_inode->i_op->follow_link(dentry, nd);
-+ if (!err && it != NULL && !(it->it_int_flags & IT_FL_FOLLOWED)) {
-+ /* vfs_follow_link was never called */
++ if (!err && it != NULL && !(it->it_int_flags & IT_FL_FOLLOWED)) {
++ /* vfs_follow_link was never called */
+ intent_release(it);
-+ path_release(nd);
-+ err = -ENOLINK;
-+ }
++ path_release(nd);
++ err = -ENOLINK;
++ }
current->link_count--;
return err;
loop:
*/
dentry = nd->dentry;
- if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
-+ revalidate_again:
++ revalidate_again:
+ if (dentry && dentry->d_op && dentry->d_op->d_revalidate_it) {
+ err = -ESTALE;
+ if (!dentry->d_op->d_revalidate_it(dentry, 0, it)) {
-+ struct dentry *new;
-+ err = permission(dentry->d_parent->d_inode,
-+ MAY_EXEC);
-+ if (err)
-+ break;
-+ new = real_lookup(dentry->d_parent,
-+ &dentry->d_name, 0, NULL);
++ struct dentry *new;
++ err = permission(dentry->d_parent->d_inode,
++ MAY_EXEC);
++ if (err)
++ break;
++ new = real_lookup(dentry->d_parent,
++ &dentry->d_name, 0, NULL);
+ d_invalidate(dentry);
-+ dput(dentry);
-+ dentry = new;
-+ goto revalidate_again;
++ dput(dentry);
++ dentry = new;
++ goto revalidate_again;
+ }
-+ }
-+ else if (dentry && dentry->d_op && dentry->d_op->d_revalidate){
++ }
++ else if (dentry && dentry->d_op && dentry->d_op->d_revalidate){
err = -ESTALE;
if (!dentry->d_op->d_revalidate(dentry, 0)) {
d_invalidate(dentry);
return retval;
}
-+static int vfs_create_it(struct inode *dir, struct dentry *dentry, int mode,
-+ struct lookup_intent *it)
++static int vfs_create_it(struct inode *dir, struct dentry *dentry, int mode,
++ struct lookup_intent *it)
+{
+ int error;
+
+
+ DQUOT_INIT(dir);
+ lock_kernel();
-+ if (dir->i_op->create_it)
-+ error = dir->i_op->create_it(dir, dentry, mode, it);
-+ else
-+ error = dir->i_op->create(dir, dentry, mode);
++ if (dir->i_op->create_it)
++ error = dir->i_op->create_it(dir, dentry, mode, it);
++ else
++ error = dir->i_op->create(dir, dentry, mode);
+ unlock_kernel();
+exit_lock:
+ up(&dir->i_zombie);
DQUOT_INIT(dir);
lock_kernel();
- error = dir->i_op->create(dir, dentry, mode);
-+ error = dir->i_op->create(dir, dentry, mode);
++ error = dir->i_op->create(dir, dentry, mode);
unlock_kernel();
exit_lock:
up(&dir->i_zombie);
+extern struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt,
+ int flags, struct lookup_intent *it);
+
-+struct file *filp_open(const char * pathname, int open_flags, int mode)
++struct file *filp_open(const char * pathname, int open_flags, int mode)
{
int acc_mode, error = 0;
- struct inode *inode;
UPDATE_ATIME(dentry->d_inode);
- error = dentry->d_inode->i_op->follow_link(dentry, &nd);
+ nd.it = ⁢
-+ error = dentry->d_inode->i_op->follow_link(dentry, &nd);
++ error = dentry->d_inode->i_op->follow_link(dentry, &nd);
+ if (error) {
+ intent_release(&it);
+ } else if (!(it.it_int_flags & IT_FL_FOLLOWED)) {
}
+ if (nd.dentry->d_inode->i_op->rmdir_raw) {
+ struct inode_operations *op = nd.dentry->d_inode->i_op;
-+
++
+ error = op->rmdir_raw(&nd);
+ /* the file system wants to use normal vfs path now */
+ if (error != -EOPNOTSUPP)
if (old_nd.mnt != nd.mnt)
goto out_release;
- new_dentry = lookup_create(&nd, 0);
-+ if (nd.dentry->d_inode->i_op->link_raw) {
-+ struct inode_operations *op = nd.dentry->d_inode->i_op;
-+ error = op->link_raw(&old_nd, &nd);
-+ /* the file system wants to use normal vfs path now */
-+ if (error != -EOPNOTSUPP)
-+ goto out_release;
-+ }
++ if (nd.dentry->d_inode->i_op->link_raw) {
++ struct inode_operations *op = nd.dentry->d_inode->i_op;
++ error = op->link_raw(&old_nd, &nd);
++ /* the file system wants to use normal vfs path now */
++ if (error != -EOPNOTSUPP)
++ goto out_release;
++ }
+ new_dentry = lookup_create(&nd, 0, NULL);
error = PTR_ERR(new_dentry);
if (!IS_ERR(new_dentry)) {
goto exit2;
+ if (old_dir->d_inode->i_op->rename_raw) {
-+ lock_kernel();
++ lock_kernel();
+ error = old_dir->d_inode->i_op->rename_raw(&oldnd, &newnd);
-+ unlock_kernel();
++ unlock_kernel();
+ /* the file system wants to use normal vfs path now */
+ if (error != -EOPNOTSUPP)
+ goto exit2;
if (page) {
kunmap(page);
page_cache_release(page);
---- linux-2.4.18-p4smp/fs/open.c~vfs_intent-2.4.18-18-chaos65 2003-07-08 14:41:38.000000000 -0600
-+++ linux-2.4.18-p4smp-braam/fs/open.c 2003-07-08 14:45:17.000000000 -0600
+--- linux-2.4.18-p4smp/fs/open.c~vfs_intent-2.4.18-18-chaos65 2003-07-09 12:17:30.000000000 -0600
++++ linux-2.4.18-p4smp-braam/fs/open.c 2003-07-09 13:20:37.000000000 -0600
@@ -19,6 +19,8 @@
#include <asm/uaccess.h>
+ if (op->setattr_raw) {
+ newattrs.ia_valid |= ATTR_RAW;
+ error = op->setattr_raw(inode, &newattrs);
-+ } else
++ } else
+ error = notify_change(dentry, &newattrs);
up(&inode->i_sem);
return error;
}
if (f->f_op && f->f_op->open) {
-+ f->f_it = it;
++ f->f_it = it;
error = f->f_op->open(inode,f);
-+ f->f_it = NULL;
++ f->f_it = NULL;
if (error)
goto cleanup_all;
}
/*
* Find an empty file descriptor entry, and mark it busy.
*/
---- linux-2.4.18-p4smp/fs/stat.c~vfs_intent-2.4.18-18-chaos65 2003-07-08 14:41:38.000000000 -0600
-+++ linux-2.4.18-p4smp-braam/fs/stat.c 2003-07-08 14:45:17.000000000 -0600
+--- linux-2.4.18-p4smp/fs/stat.c~vfs_intent-2.4.18-18-chaos65 2003-07-09 12:17:30.000000000 -0600
++++ linux-2.4.18-p4smp-braam/fs/stat.c 2003-07-09 13:20:37.000000000 -0600
@@ -17,21 +17,24 @@
* Revalidate the inode. This is required for proper NFS attribute caching.
*/
}
-static int do_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
-+static int do_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat,
-+ struct lookup_intent *it)
++static int do_getattr(struct vfsmount *mnt, struct dentry *dentry,
++ struct kstat *stat, struct lookup_intent *it)
{
int res = 0;
unsigned int blocks, indirect;
UPDATE_ATIME(inode);
error = inode->i_op->readlink(nd.dentry, buf, bufsiz);
}
---- linux-2.4.18-p4smp/fs/proc/base.c~vfs_intent-2.4.18-18-chaos65 2003-07-08 14:45:12.000000000 -0600
-+++ linux-2.4.18-p4smp-braam/fs/proc/base.c 2003-07-08 14:45:32.000000000 -0600
+--- linux-2.4.18-p4smp/fs/proc/base.c~vfs_intent-2.4.18-18-chaos65 2003-07-09 12:20:46.000000000 -0600
++++ linux-2.4.18-p4smp-braam/fs/proc/base.c 2003-07-09 13:20:37.000000000 -0600
@@ -465,6 +465,9 @@ static int proc_pid_follow_link(struct d
error = inode->u.proc_i.op.proc_get_link(inode, &nd->dentry, &nd->mnt);
nd->last_type = LAST_BIND;
-+
-+ if (nd->it != NULL)
-+ nd->it->it_int_flags |= IT_FL_FOLLOWED;
++
++ if (nd->it != NULL)
++ nd->it->it_int_flags |= IT_FL_FOLLOWED;
out:
return error;
}
---- linux-2.4.18-p4smp/include/linux/dcache.h~vfs_intent-2.4.18-18-chaos65 2003-07-08 14:41:38.000000000 -0600
-+++ linux-2.4.18-p4smp-braam/include/linux/dcache.h 2003-07-08 14:45:17.000000000 -0600
-@@ -6,6 +6,44 @@
+--- linux-2.4.18-p4smp/include/linux/dcache.h~vfs_intent-2.4.18-18-chaos65 2003-07-09 13:15:23.000000000 -0600
++++ linux-2.4.18-p4smp-braam/include/linux/dcache.h 2003-07-09 13:32:08.000000000 -0600
+@@ -6,6 +6,45 @@
#include <asm/atomic.h>
+ #include <linux/gdb.h>
#include <linux/mount.h>
-
-+#define IT_OPEN (1)
-+#define IT_CREAT (1<<1)
-+#define IT_READDIR (1<<2)
-+#define IT_GETATTR (1<<3)
-+#define IT_LOOKUP (1<<4)
-+#define IT_UNLINK (1<<5)
-+#define IT_GETXATTR (1<<6)
-+#define IT_EXEC (1<<7)
-+#define IT_PIN (1<<8)
++#include <linux/string.h>
++
++#define IT_OPEN 0x0001
++#define IT_CREAT 0x0002
++#define IT_READDIR 0x0004
++#define IT_GETATTR 0x0008
++#define IT_LOOKUP 0x0010
++#define IT_UNLINK 0x0020
++#define IT_GETXATTR 0x0040
++#define IT_EXEC 0x0080
++#define IT_PIN 0x0100
+
-+#define IT_FL_LOCKED (1)
-+#define IT_FL_FOLLOWED (1<<1) /* set by vfs_follow_link */
++#define IT_FL_LOCKED 0x0001
++#define IT_FL_FOLLOWED 0x0002 /* set by vfs_follow_link */
+
+#define INTENT_MAGIC 0x19620323
+
+
+static inline void intent_init(struct lookup_intent *it, int op, int flags)
+{
-+ memset(it, 0, sizeof(*it));
-+ it->it_magic = INTENT_MAGIC;
-+ it->it_op = op;
-+ it->it_flags = flags;
++ memset(it, 0, sizeof(*it));
++ it->it_magic = INTENT_MAGIC;
++ it->it_op = op;
++ it->it_flags = flags;
+}
+
-+
+
/*
* linux/include/linux/dcache.h
- *
-@@ -91,8 +129,22 @@ struct dentry_operations {
+@@ -92,8 +131,22 @@ struct dentry_operations {
int (*d_delete)(struct dentry *);
void (*d_release)(struct dentry *);
void (*d_iput)(struct dentry *, struct inode *);
};
+#define PIN(de,mnt,flag) if (de->d_op && de->d_op->d_pin) \
-+ de->d_op->d_pin(de, mnt, flag);
++ de->d_op->d_pin(de, mnt, flag);
+#define UNPIN(de,mnt,flag) if (de->d_op && de->d_op->d_unpin) \
-+ de->d_op->d_unpin(de, mnt, flag);
++ de->d_op->d_unpin(de, mnt, flag);
+
+
+/* defined in fs/namei.c */
/* the dentry parameter passed to d_hash and d_compare is the parent
* directory of the entries to be compared. It is used in case these
* functions need any directory specific information for determining
-@@ -124,6 +176,7 @@ d_iput: no no yes
+@@ -125,6 +178,7 @@ d_iput: no no yes
* s_nfsd_free_path semaphore will be down
*/
#define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */
extern int vfs_unlink(struct inode *, struct dentry *);
-extern int vfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
+int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
-+ struct inode *new_dir, struct dentry *new_dentry);
++ struct inode *new_dir, struct dentry *new_dentry);
/*
* File types
extern int page_follow_link(struct dentry *, struct nameidata *);
extern struct inode_operations page_symlink_inode_operations;
--- linux-2.4.18-p4smp/kernel/fork.c~vfs_intent-2.4.18-18-chaos65 2003-03-24 11:22:37.000000000 -0700
-+++ linux-2.4.18-p4smp-braam/kernel/fork.c 2003-07-08 14:45:17.000000000 -0600
++++ linux-2.4.18-p4smp-braam/kernel/fork.c 2003-07-09 13:20:37.000000000 -0600
@@ -399,10 +399,13 @@ static inline struct fs_struct *__copy_f
fs->umask = old->umask;
read_lock(&old->lock);
fs->rootmnt = mntget(old->rootmnt);
-+ PIN(old->pwd, old->pwdmnt, 0);
-+ PIN(old->root, old->rootmnt, 1);
++ PIN(old->pwd, old->pwdmnt, 0);
++ PIN(old->root, old->rootmnt, 1);
fs->root = dget(old->root);
fs->pwdmnt = mntget(old->pwdmnt);
fs->pwd = dget(old->pwd);
if (old->altroot) {
-+ PIN(old->altroot, old->altrootmnt, 1);
++ PIN(old->altroot, old->altrootmnt, 1);
fs->altrootmnt = mntget(old->altrootmnt);
fs->altroot = dget(old->altroot);
} else {
--- linux-2.4.18-p4smp/kernel/exit.c~vfs_intent-2.4.18-18-chaos65 2002-10-29 12:27:38.000000000 -0700
-+++ linux-2.4.18-p4smp-braam/kernel/exit.c 2003-07-08 14:45:17.000000000 -0600
++++ linux-2.4.18-p4smp-braam/kernel/exit.c 2003-07-09 13:20:37.000000000 -0600
@@ -303,11 +303,14 @@ static inline void __put_fs_struct(struc
{
/* No need to hold fs->lock if we are killing it */
if (atomic_dec_and_test(&fs->count)) {
-+ UNPIN(fs->pwd, fs->pwdmnt, 0);
-+ UNPIN(fs->root, fs->rootmnt, 1);
++ UNPIN(fs->pwd, fs->pwdmnt, 0);
++ UNPIN(fs->root, fs->rootmnt, 1);
dput(fs->root);
mntput(fs->rootmnt);
dput(fs->pwd);
mntput(fs->pwdmnt);
if (fs->altroot) {
-+ UNPIN(fs->altroot, fs->altrootmnt, 1);
++ UNPIN(fs->altroot, fs->altrootmnt, 1);
dput(fs->altroot);
mntput(fs->altrootmnt);
}
---- linux-2.4.18-p4smp/kernel/ksyms.c~vfs_intent-2.4.18-18-chaos65 2003-07-08 14:41:49.000000000 -0600
-+++ linux-2.4.18-p4smp-braam/kernel/ksyms.c 2003-07-08 14:45:17.000000000 -0600
+--- linux-2.4.18-p4smp/kernel/ksyms.c~vfs_intent-2.4.18-18-chaos65 2003-07-09 13:20:35.000000000 -0600
++++ linux-2.4.18-p4smp-braam/kernel/ksyms.c 2003-07-09 13:20:37.000000000 -0600
@@ -294,6 +294,7 @@ EXPORT_SYMBOL(read_cache_page);
EXPORT_SYMBOL(set_page_dirty);
EXPORT_SYMBOL(vfs_readlink);
exports_2.4.20-rh-hp.patch
kmem_cache_validate_hp.patch
lustre_version.patch
-vfs_intent-2.4.20-vanilla.patch
+vfs_intent-2.4.20-hp.patch
invalidate_show.patch
export-truncate.patch
iod-stock-24-exports_hp.patch
ext3-noread-2.4.20.patch
extN-wantedi.patch
ext3-san-2.4.20.patch
+ext3-map_inode_page.patch
+ext3-error-export.patch
iopen-2.4.20.patch
tcp-zero-copy.patch
ext3-noread-2.4.20.patch
extN-wantedi.patch
ext3-san-2.4.20.patch
+ext3-map_inode_page.patch
+ext3-error-export.patch
iopen-2.4.20.patch
tcp-zero-copy.patch
struct obd_uuid remote_uuid;
struct list_head *p;
char *str, *tmp;
- int rc, abort_recovery;
+ int rc = 0, abort_recovery;
ENTRY;
LASSERT_REQSWAB (req, 0);
#ifndef LLITE_INTERNAL_H
#define LLITE_INTERNAL_H
+
+struct ll_sb_info;
struct lustre_handle;
struct lov_stripe_md;
-struct ll_sb_info;
+
+extern void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi);
+extern struct proc_dir_entry *proc_lustre_fs_root;
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+# define hlist_del_init list_del_init
+#endif
+
+static inline struct inode *ll_info2i(struct ll_inode_info *lli)
+{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
+ return &lli->lli_vfs_inode;
+#else
+ return list_entry(lli, struct inode, u.generic_ip);
+#endif
+}
/* llite/commit_callback.c */
int ll_commitcbd_setup(struct ll_sb_info *);
void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi);
/* llite/namei.c */
+struct inode *ll_iget(struct super_block *sb, ino_t hash,
+ struct lustre_md *lic);
struct dentry *ll_find_alias(struct inode *, struct dentry *);
int ll_it_open_error(int phase, struct lookup_intent *it);
int ll_mdc_cancel_unused(struct lustre_handle *conn, struct inode *inode,
int flags, void *opaque);
/* llite/rw.c */
+void ll_end_writeback(struct inode *, struct page *);
+
+void ll_remove_dirty(struct inode *inode, unsigned long start,
+ unsigned long end);
int ll_rd_dirty_pages(char *page, char **start, off_t off, int count,
int *eof, void *data);
int ll_rd_max_dirty_pages(char *page, char **start, off_t off, int count,
int ll_mark_dirty_page(struct lustre_handle *conn, struct lov_stripe_md *lsm,
unsigned long index);
+/* llite/file.c */
+extern int ll_inode_revalidate_it(struct dentry *dentry, struct lookup_intent *);
+
/* llite/super.c */
int ll_inode_setattr(struct inode *inode, struct iattr *attr, int do_trunc);
int ll_setattr(struct dentry *de, struct iattr *attr);
+/* iod.c */
+#define IO_STAT_ADD(FIS, STAT, VAL) do { \
+ struct file_io_stats *_fis_ = (FIS); \
+ spin_lock(&_fis_->fis_lock); \
+ _fis_->fis_##STAT += VAL; \
+ spin_unlock(&_fis_->fis_lock); \
+} while (0)
+
+#define INODE_IO_STAT_ADD(INODE, STAT, VAL) \
+ IO_STAT_ADD(&ll_i2sbi(INODE)->ll_iostats, STAT, VAL)
+
+#define PAGE_IO_STAT_ADD(PAGE, STAT, VAL) \
+ INODE_IO_STAT_ADD((PAGE)->mapping, STAT, VAL)
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
+/* XXX lliod needs more work in 2.5 before being proven and brought back
+ * to 2.4, it'll at least require a patch to introduce page->private */
+int lliod_start(struct ll_sb_info *sbi, struct inode *inode);
+void lliod_stop(struct ll_sb_info *sbi);
+#else
+#define lliod_start(sbi, inode) ({int _ret = 0; (void)sbi, (void)inode; _ret;})
+#define lliod_stop(sbi) do { (void)sbi; } while (0)
+#endif
+void lliod_wakeup(struct inode *inode);
+void lliod_give_plist(struct inode *inode, struct plist *plist, int rw);
+void lliod_give_page(struct inode *inode, struct page *page, int rw);
+void plist_init(struct plist *plist); /* for lli initialization.. */
+
+void ll_lldo_init(struct ll_dirty_offsets *lldo);
+void ll_record_dirty(struct inode *inode, unsigned long offset);
+void ll_remove_dirty(struct inode *inode, unsigned long start,
+ unsigned long end);
+int ll_find_dirty(struct ll_dirty_offsets *lldo, unsigned long *start,
+ unsigned long *end);
+int ll_farthest_dirty(struct ll_dirty_offsets *lldo, unsigned long *farthest);
+
+
+/* llite/super25.c */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
+int ll_getattr(struct vfsmount *mnt, struct dentry *de,
+ struct lookup_intent *it,
+ struct kstat *stat);
+#endif
+
+
+/* llite/dcache.c */
+void ll_intent_release(struct lookup_intent *);
+extern void ll_set_dd(struct dentry *de);
+
+/* llite/rw.c */
+void ll_truncate(struct inode *inode);
+void ll_end_writeback(struct inode *inode, struct page *page);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+int ll_check_dirty(struct super_block *sb);
+int ll_batch_writepage(struct inode *inode, struct obdo *oa, struct page *page);
+#else
+#define ll_check_dirty(SB) do { (void)SB; } while (0)
+#endif
+
+/* llite/llite_lib.c */
+
+extern struct super_operations ll_super_operations;
+
+char *ll_read_opt(const char *opt, char *data);
+int ll_set_opt(const char *opt, char *data, int fl);
+void ll_options(char *options, char **ost, char **mds, int *flags);
+void ll_lli_init(struct ll_inode_info *lli);
+int ll_fill_super(struct super_block *sb, void *data, int silent);
+void ll_put_super(struct super_block *sb);
+void ll_clear_inode(struct inode *inode);
+int ll_attr2inode(struct inode *inode, struct iattr *attr, int trunc);
+int ll_inode_setattr(struct inode *inode, struct iattr *attr, int do_trunc);
+int ll_setattr_raw(struct inode *inode, struct iattr *attr);
+int ll_setattr(struct dentry *de, struct iattr *attr);
+int ll_statfs(struct super_block *sb, struct kstatfs *sfs);
+void ll_update_inode(struct inode *inode, struct mds_body *body,
+ struct lov_stripe_md *lsm);
+int it_disposition(struct lookup_intent *it, int flag);
+void it_set_disposition(struct lookup_intent *it, int flag);
+void ll_read_inode2(struct inode *inode, void *opaque);
+void ll_umount_begin(struct super_block *sb);
+
+
+
#endif /* LLITE_INTERNAL_H */
# This code is issued under the GNU General Public License.
# See the file COPYING in this distribution
-include fs/lustre/portals/Kernelenv
+include $(src)/../portals/Kernelenv
obj-y += mds.o
-
-mds-objs := mds_lov.o handler.o mds_reint.o mds_fs.o lproc_mds.o mds_internal.h mds_updates.o mds_open.o simple.o target.o
+mds-objs := mds_lov.o handler.o mds_reint.o mds_fs.o lproc_mds.o mds_open.o \
+ mds_lib.o
+
for (i = 0; i < objcount; i++, o++) {
struct dentry *dentry;
struct inode *inode;
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+ sector_t (*fs_bmap)(struct address_space *, sector_t);
+#else
int (*fs_bmap)(struct address_space *, long);
+#endif
int j;
dentry = filter_oa2dentry(exp->exp_obd, oa);
{
struct dentry *dentry;
struct nameidata nd;
- kdev_t dev;
- KDEVT_VAL(dev, 0);
+ kdev_t dev = KDEVT_INIT(0);
if (!path_init(path, LOOKUP_FOLLOW, &nd))
return 0;
config.log
config.status
configure
+.*.o.cmd
-EXTRA_CFLAGS= -Ifs/lustre/include -Ifs/lustre/portals/include
+EXTRA_CFLAGS := -Ifs/lustre/include -Ifs/lustre/portals/include
+# portals/utils/debug.c wants <linux/version.h> from userspace. sigh.
+HOSTCFLAGS := -I@LINUX@/include $(EXTRA_CFLAGS)
+LIBREADLINE := @LIBREADLINE@
+# 2.5's makefiles aren't nice to cross dir libraries in host programs
+PTLCTLOBJS := debug.o l_ioctl.o parser.o portals.o
-EXTRA_CFLAGS= -Ifs/lustre/include -Ifs/lustre/portals/include
+EXTRA_CFLAGS := -Ifs/lustre/include -Ifs/lustre/portals/include
+HOSTCFLAGS := $(EXTRA_CFLAGS)
+# the kernel doesn't want us to build archives for host binaries :/
+PTLCTLOBJS := debug.o l_ioctl.o parser.o portals.o
-include fs/lustre/portals/Kernelenv
+include $(src)/Kernelenv
-obj-y += portals/
+# The ordering of these determines the order that each subsystem's
+# module_init() functions are called in. if these are changed make sure
+# they reflect the dependencies between each subsystem's _init functions.
obj-y += libcfs/
-obj-y += knals/
+obj-y += portals/
obj-y += router/
+obj-y += knals/
+obj-y += tests/
+
+obj-m += utils/
AC_ARG_WITH(linux, [ --with-linux=[path] set path to Linux source (default=/usr/src/linux)],LINUX=$with_linux,LINUX=/usr/src/linux)
AC_SUBST(LINUX)
+if test x$enable_inkernel = xyes ; then
+ echo ln -s `pwd` $LINUX/fs/lustre
+ rm $LINUX/fs/lustre
+ ln -s `pwd` $LINUX/fs/lustre
+fi
-# --------- UML? --------------------
+# --------------------
AC_MSG_CHECKING(if you are running user mode linux for $host_cpu ...)
if test $host_cpu = "lib" ; then
host_cpu="lib"
MOD_LINK=elf64_ia64
;;
+ x86_64 )
+ AC_MSG_RESULT($host_cpu)
+ KCFLAGS='-g -O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fomit-frame-pointer -mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks -finline-limit=2000 -fno-strength-reduce -fno-asynchronous-unwind-tables'
+ KCPPFLAGS='-D__KERNEL__ -DMODULE'
+ MOD_LINK=elf_x86_64
+;;
+
sparc64 )
AC_MSG_RESULT($host_cpu)
KCFLAGS='-O2 -Wall -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing -fno-common -Wno-unused -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare -Wa,--undeclared-regs'
#define LOWEST_BIT_SET(x) ((x) & ~((x) - 1))
-#ifndef CONFIG_SMP
-# define smp_processor_id() 0
-#endif
-
/*
* Debugging
*/
#define D_RPCTRACE (1 << 20) /* for distributed debugging */
#define D_VFSTRACE (1 << 21)
-#ifndef __KERNEL__
-#define THREAD_SIZE 8192
+#ifdef __KERNEL__
+# include <linux/sched.h> /* THREAD_SIZE */
+#else
+# define THREAD_SIZE 8192
#endif
-#ifdef __ia64__
-#define CDEBUG_STACK() (THREAD_SIZE - \
+
+#ifdef __KERNEL__
+# ifdef __ia64__
+# define CDEBUG_STACK (THREAD_SIZE - \
((unsigned long)__builtin_dwarf_cfa() & \
(THREAD_SIZE - 1)))
-#else
-#define CDEBUG_STACK() (THREAD_SIZE - \
+# else
+# define CDEBUG_STACK (THREAD_SIZE - \
((unsigned long)__builtin_frame_address(0) & \
(THREAD_SIZE - 1)))
-#endif
+# endif
-#ifdef __KERNEL__
#define CHECK_STACK(stack) \
do { \
if ((stack) > 3*THREAD_SIZE/4 && (stack) > portal_stack) { \
/*panic("LBUG");*/ \
} \
} while (0)
-#else
+#else /* __KERNEL __ */
#define CHECK_STACK(stack) do { } while(0)
-#endif
+#define CDEBUG_STACK (0L)
+#endif /* __KERNEL__ */
#if 1
#define CDEBUG(mask, format, a...) \
do { \
- CHECK_STACK(CDEBUG_STACK()); \
+ CHECK_STACK(CDEBUG_STACK); \
if (!(mask) || ((mask) & (D_ERROR | D_EMERG)) || \
(portal_debug & (mask) && \
portal_subsystem_debug & (1 << (DEBUG_SUBSYSTEM >> 24)))) \
portals_debug_msg(DEBUG_SUBSYSTEM, mask, \
__FILE__, __FUNCTION__, __LINE__, \
- CDEBUG_STACK(), format, ## a); \
+ CDEBUG_STACK, format, ## a); \
} while (0)
#define CWARN(format, a...) CDEBUG(D_WARNING, format, ## a)
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) */
#ifdef PORTAL_DEBUG
-extern void kportal_assertion_failed(char *expr,char *file,char *func,int line);
+extern void kportal_assertion_failed(char *expr, char *file, const char *func,
+ const int line);
#define LASSERT(e) ((e) ? 0 : kportal_assertion_failed( #e , __FILE__, \
__FUNCTION__, __LINE__))
#else
#endif /* PORTALS_PROFILING */
/* debug.c */
-void portals_run_lbug_upcall(char * file, char *fn, int line);
+void portals_run_lbug_upcall(char * file, const char *fn, const int line);
void portals_debug_dumplog(void);
int portals_debug_init(unsigned long bufsize);
int portals_debug_cleanup(void);
# warning printf has been defined as a macro...
# undef printf
#endif
-void portals_debug_msg (int subsys, int mask, char *file, char *fn, int line,
- unsigned long stack, const char *format, ...)
+void portals_debug_msg(int subsys, int mask, char *file, const char *fn,
+ const int line, unsigned long stack,
+ const char *format, ...)
__attribute__ ((format (printf, 7, 8)));
#else
-void portals_debug_msg (int subsys, int mask, char *file, char *fn,
- int line, unsigned long stack,
+void portals_debug_msg (int subsys, int mask, char *file, const char *fn,
+ const int line, unsigned long stack,
const char *format, ...);
#endif /* __GNUC__ */
void portals_debug_set_level(unsigned int debug_level);
Makefile
Makefile.in
+.*.o.cmd
-include ../Kernelenv
+include $(obj)/../Kernelenv
obj-y = socknal/
-# more coming...
\ No newline at end of file
+# more coming...
return &kgmnal_api;
}
-static void __exit
+static void /*__exit*/
kgmnal_finalize(void)
{
struct list_head *tmp;
/* Called by kernel at module unload time */
-static void __exit
+static void /*__exit*/
kscimacnal_finalize(void)
{
/* FIXME: How should the shutdown procedure really look? */
}
-void __exit
+void /*__exit*/
ktoenal_module_fini (void)
{
CDEBUG(D_MALLOC, "before NAL cleanup: kmem %d\n",
spin_lock_irqsave (&ktoenal_data.ksnd_sched_lock, *irq_flags);
goto get_fmb; /* => go get a fwd msg buffer */
default:
+ break;
}
/* Not Reached */
LBUG ();
goto out; /* (later) */
default:
+ break;
}
/* Not Reached */
Makefile
Makefile.in
link-stamp
+.*.o.cmd
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
/* 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;
portal_debug = debug_level;
}
-void portals_run_lbug_upcall(char * file, char *fn, int line)
+void portals_run_lbug_upcall(char *file, const char *fn, const int line)
{
char *argv[6];
char *envp[3];
argv[0] = portals_upcall;
argv[1] = "LBUG";
argv[2] = file;
- argv[3] = fn;
+ argv[3] = (char *)fn;
argv[4] = buf;
argv[5] = NULL;
struct semaphore nal_cmd_sem;
#ifdef PORTAL_DEBUG
-void
-kportal_assertion_failed (char *expr, char *file, char *func, int line)
+void kportal_assertion_failed(char *expr, char *file, const char *func,
+ const int line)
{
- portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK(),
+ portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK,
"ASSERTION(%s) failed\n", expr);
LBUG_WITH_LOC(file, func, line);
}
.deps
Makefile
Makefile.in
+.*.o.cmd
# This code is issued under the GNU General Public License.
# See the file COPYING in this distribution
-include ../Kernelenv
+include $(src)/../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
.deps
Makefile
Makefile.in
+.*.o.cmd
# This code is issued under the GNU General Public License.
# See the file COPYING in this distribution
-include ../Kernelenv
+include $(src)/../Kernelenv
obj-y += kptlrouter.o
kptlrouter-objs := router.o proc.o
#include "router.h"
-struct list_head kpr_routes;
-struct list_head kpr_nals;
+LIST_HEAD(kpr_routes);
+LIST_HEAD(kpr_nals);
unsigned long long kpr_fwd_bytes;
unsigned long kpr_fwd_packets;
*
* Once in a blue moon we register/deregister NALs and add/remove routing
* entries (thread context only)... */
-rwlock_t kpr_rwlock;
+rwlock_t kpr_rwlock = RW_LOCK_UNLOCKED;
kpr_router_interface_t kpr_router_interface = {
kprri_register: kpr_register_nal,
int
kpr_register_nal (kpr_nal_interface_t *nalif, void **argp)
{
- long flags;
+ unsigned long flags;
struct list_head *e;
kpr_nal_entry_t *ne;
void
kpr_shutdown_nal (void *arg)
{
- long flags;
+ unsigned long flags;
kpr_nal_entry_t *ne = (kpr_nal_entry_t *)arg;
CDEBUG (D_OTHER, "Shutting down NAL %d\n", ne->kpne_interface.kprni_nalid);
void
kpr_deregister_nal (void *arg)
{
- long flags;
+ unsigned long flags;
kpr_nal_entry_t *ne = (kpr_nal_entry_t *)arg;
CDEBUG (D_OTHER, "Deregister NAL %d\n", ne->kpne_interface.kprni_nalid);
kpr_add_route (int gateway_nalid, ptl_nid_t gateway_nid, ptl_nid_t lo_nid,
ptl_nid_t hi_nid)
{
- long flags;
+ unsigned long flags;
struct list_head *e;
kpr_route_entry_t *re;
int
kpr_del_route (ptl_nid_t nid)
{
- long flags;
+ unsigned long flags;
struct list_head *e;
CDEBUG(D_OTHER, "Del route "LPX64"\n", nid);
return (-ENOENT);
}
-static void __exit
+static void /*__exit*/
kpr_finalise (void)
{
LASSERT (list_empty (&kpr_nals));
CDEBUG(D_MALLOC, "kpr_initialise: kmem %d\n",
atomic_read(&portal_kmemory));
- rwlock_init(&kpr_rwlock);
- INIT_LIST_HEAD(&kpr_routes);
- INIT_LIST_HEAD(&kpr_nals);
-
kpr_proc_init();
PORTAL_SYMBOL_REGISTER(kpr_router_interface);
Makefile
Makefile.in
.deps
+.*.o.cmd
/* called by the portals_ioctl for ping requests */
-static int kping_client(struct portal_ioctl_data *args)
+int kping_client(struct portal_ioctl_data *args)
{
PORTAL_ALLOC (client, sizeof(struct pingcli_data));
if (client == NULL)
} /* pingcli_init() */
-static void __exit pingcli_cleanup(void)
+static void /*__exit*/ pingcli_cleanup(void)
{
PORTAL_SYMBOL_UNREGISTER (kping_client);
} /* pingcli_cleanup() */
#include <asm/semaphore.h>
#define STDSIZE (sizeof(int) + sizeof(int) + sizeof(struct timeval))
-#define MAXSIZE (16*1024*1024)
+#define MAXSIZE (16*1024)
static unsigned ping_head_magic;
static unsigned ping_bulk_magic;
-static int nal = 0; // Your NAL,
+static int nal = SOCKNAL; // Your NAL,
static unsigned long packets_valid = 0; // Valid packets
static int running = 1;
atomic_t pkt;
} /* pingsrv_init() */
-static void __exit pingsrv_cleanup(void)
+static void /*__exit*/ pingsrv_cleanup(void)
{
remove_proc_entry ("net/pingsrv", NULL);
/* called by the portals_ioctl for ping requests */
-static int kping_client(struct portal_ioctl_data *args)
+int kping_client(struct portal_ioctl_data *args)
{
PORTAL_ALLOC (client, sizeof(struct pingcli_data));
} /* pingcli_init() */
-static void __exit pingcli_cleanup(void)
+static void /*__exit*/ pingcli_cleanup(void)
{
PORTAL_SYMBOL_UNREGISTER (kping_client);
} /* pingcli_cleanup() */
} /* pingsrv_init() */
-static void __exit pingsrv_cleanup(void)
+static void /*__exit*/ pingsrv_cleanup(void)
{
remove_proc_entry ("net/pingsrv", NULL);
/* 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;
CHECK_VALUE (REINT_OPEN);
CHECK_VALUE (REINT_MAX);
- CHECK_VALUE (IT_INTENT_EXEC);
- CHECK_VALUE (IT_OPEN_LOOKUP);
- CHECK_VALUE (IT_OPEN_NEG);
- CHECK_VALUE (IT_OPEN_POS);
- CHECK_VALUE (IT_OPEN_CREATE);
- CHECK_VALUE (IT_OPEN_OPEN);
+ CHECK_VALUE (DISP_IT_EXECD);
+ CHECK_VALUE (DISP_LOOKUP_EXECD);
+ CHECK_VALUE (DISP_LOOKUP_NEG);
+ CHECK_VALUE (DISP_LOOKUP_POS);
+ CHECK_VALUE (DISP_OPEN_CREATE);
+ CHECK_VALUE (DISP_OPEN_OPEN);
CHECK_VALUE (MDS_STATUS_CONN);
CHECK_VALUE (MDS_STATUS_LOV);