rm -rf $(distdir)/figs/CVS
include $(top_srcdir)/Rules
-
--- /dev/null
+
+#define MGR_STOPPING 1
+#define MGR_RUNNING 2
+#define MGR_STOPPED 4
+#define MGR_KILLED 8
+#define MGR_EVENT 16
+#define MGR_RECOVERING 32
+#define MGR_SIGNAL 64
+
+struct lustre_ha_mgr {
+ __u32 mgr_flags;
+ struct task_struct *mgr_thread;
+ wait_queue_head_t mgr_waitq;
+ wait_queue_head_t mgr_ctl_waitq;
+ spinlock_t mgr_lock;
+};
+
+struct lustre_ha_thread {
+ char *name;
+ struct lustre_ha_mgr *mgr;
+ struct obd_device *dev;
+};
* This code is issued under the GNU General Public License.
* See the file COPYING in this distribution
*
- * Copyright (C), 1999, Stelias Computing Inc
*
*
- */
+ *
+
#ifndef _LL_H
#include <linux/lustre_mds.h>
#include <linux/obdo.h>
+#define LUSTRE_LITE_NAME "llite"
+
extern kmem_cache_t *ll_file_data_slab;
struct ll_file_data {
__u64 fd_mdshandle;
struct ptlrpc_client {
struct lustre_peer cli_server;
struct obd_device *cli_obd;
+ struct list_head cli_sending_head;
+ struct list_head cli_sent_head;
__u32 cli_request_portal;
__u32 cli_reply_portal;
spinlock_t cli_lock;
__u32 cli_xid;
+ __u32 cli_generation; /* changes upon new connection */
+ __u32 cli_epoch; /* changes when peer changes */
+ __u32 cli_bootcount; /* peer's boot count */
struct semaphore cli_rpc_sem;
};
__u32 rq_req_portal;
struct lustre_peer rq_peer;
+ struct ptlrpc_client *rq_client;
};
struct ptlrpc_bulk_desc {
void ptlrpc_link_svc_me(struct ptlrpc_service *service, int i);
/* rpc/client.c */
-int ptlrpc_connect_client(int dev, char *uuid, int req_portal, int rep_portal,
- struct ptlrpc_client *cl);
+void ptlrpc_init_client(int dev, int req_portal, int rep_portal,
+ struct ptlrpc_client *cl);
+int ptlrpc_connect_client(int dev, char *uuid, struct ptlrpc_client *cl);
int ptlrpc_queue_wait(struct ptlrpc_client *cl, struct ptlrpc_request *req);
int ptlrpc_queue_req(struct ptlrpc_client *peer, struct ptlrpc_request *req);
struct ptlrpc_request *ptlrpc_prep_req(struct ptlrpc_client *cl, int opcode,
return -EINVAL;
}
- err = ptlrpc_connect_client(-1, "ldlm",
- LDLM_REQUEST_PORTAL, LDLM_REPLY_PORTAL,
- &cl);
+ ptlrpc_init_client(-1, LDLM_REQUEST_PORTAL, LDLM_REPLY_PORTAL, &cl);
+ err = ptlrpc_connect_client(-1, "ldlm", &cl);
if (err) {
CERROR("cannot create client\n");
RETURN(-EINVAL);
DEFS:=
-MODULE = llight
-modulefs_DATA = llight.o
-EXTRA_PROGRAMS = llight
+MODULE = llite
+modulefs_DATA = llite.o
+EXTRA_PROGRAMS = llite
page.c:
-ln -s ../lib/page.c
LINX=page.c
-llight_SOURCES = page.c super.c rw.c file.c dir.c sysctl.c namei.c symlink.c
+llite_SOURCES = llite_ha.c page.c super.c rw.c file.c dir.c sysctl.c namei.c symlink.c
dist-hook:
list='$(LINX)'; for f in $$list; do rm -f $(distdir)/$$f; done
#include <linux/locks.h>
#include <asm/uaccess.h>
-#define DEBUG_SUBSYSTEM S_LLIGHT
+#define DEBUG_SUBSYSTEM S_LLITE
#include <linux/obd_support.h>
#include <linux/obd_class.h>
#include <linux/lustre_lib.h>
#include <linux/lustre_idl.h>
#include <linux/lustre_mds.h>
-#include <linux/lustre_light.h>
+#include <linux/lustre_lite.h>
typedef struct ext2_dir_entry_2 ext2_dirent;
#include <linux/pagemap.h>
#include <linux/smp_lock.h>
-#define DEBUG_SUBSYSTEM S_LLIGHT
+#define DEBUG_SUBSYSTEM S_LLITE
#include <linux/obd_support.h>
-#include <linux/lustre_light.h>
+#include <linux/lustre_lite.h>
int ll_inode_setattr(struct inode *inode, struct iattr *attr, int do_trunc);
extern int ll_setattr(struct dentry *de, struct iattr *attr);
--- /dev/null
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ * linux/mds/handler.c
+ *
+ * Lustre Metadata Server (mds) request handler
+ *
+ * Copyright (C) 2001, 2002 Cluster File Systems, Inc.
+ *
+ * This code is issued under the GNU General Public License.
+ * See the file COPYING in this distribution
+ *
+ * by Peter Braam <braam@clusterfs.com>
+ *
+ * This server is single threaded at present (but can easily be multi threaded)
+ *
+ */
+
+#define EXPORT_SYMTAB
+
+#include <linux/version.h>
+#include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/stat.h>
+#include <linux/locks.h>
+#include <linux/quotaops.h>
+#include <asm/unistd.h>
+#include <asm/uaccess.h>
+
+#define DEBUG_SUBSYSTEM S_LLITE
+
+#include <linux/lustre_lite.h>
+#include <linux/lustre_ha.h>
+#include <linux/lustre_lib.h>
+#include <linux/lustre_net.h>
+
+static int lustre_ha_check_event(struct lustre_ha_mgr *mgr)
+{
+
+
+ return 1;
+}
+
+
+static int llite_ha_main(void *arg)
+{
+ struct lustre_ha_thread *data = (struct lustre_ha_thread *)arg;
+ struct lustre_ha_mgr *mgr = data->mgr;
+
+ ENTRY;
+
+ lock_kernel();
+ daemonize();
+ spin_lock_irq(¤t->sigmask_lock);
+ sigfillset(¤t->blocked);
+ recalc_sigpending(current);
+ spin_unlock_irq(¤t->sigmask_lock);
+
+ sprintf(current->comm, data->name);
+
+ /* Record that the thread is running */
+ mgr->mgr_thread = current;
+ mgr->mgr_flags = MGR_RUNNING;
+ wake_up(&mgr->mgr_ctl_waitq);
+
+ /* And now, loop forever on requests */
+ while (1) {
+ wait_event_interruptible(mgr->mgr_waitq,
+ lustre_ha_check_event(mgr));
+
+ spin_lock(&mgr->mgr_lock);
+ schedule_timeout(5 * HZ);
+ if (mgr->mgr_flags & MGR_SIGNAL) {
+ spin_unlock(&mgr->mgr_lock);
+ EXIT;
+ break;
+ }
+
+ if (mgr->mgr_flags & MGR_STOPPING) {
+ spin_unlock(&mgr->mgr_lock);
+ EXIT;
+ break;
+ }
+
+ if (mgr->mgr_flags & MGR_EVENT) {
+ mgr->mgr_flags = MGR_RUNNING;
+
+ /* FIXME: If we move to an event-driven model,
+ * we should put the request on the stack of
+ * mds_handle instead. */
+ CERROR("MGR event\n");
+ continue;
+ }
+
+ CERROR("unknown break in service");
+ spin_unlock(&mgr->mgr_lock);
+ EXIT;
+ break;
+ }
+
+ mgr->mgr_thread = NULL;
+ mgr->mgr_flags = MGR_STOPPED;
+ wake_up(&mgr->mgr_ctl_waitq);
+ CDEBUG(D_NET, "mgr exiting process %d\n", current->pid);
+ return 0;
+}
+
+
+int llite_ha_setup(struct obd_device *dev, struct lustre_ha_mgr *mgr,
+ char *name)
+{
+ struct lustre_ha_thread d;
+ int rc;
+ ENTRY;
+
+ d.dev = dev;
+ d.mgr = mgr;
+ d.name = name;
+
+ init_waitqueue_head(&mgr->mgr_waitq);
+
+ init_waitqueue_head(&mgr->mgr_ctl_waitq);
+ rc = kernel_thread(llite_ha_main, (void *) &d,
+ CLONE_VM | CLONE_FS | CLONE_FILES);
+ if (rc < 0) {
+ CERROR("cannot start thread\n");
+ RETURN(-EINVAL);
+ }
+ wait_event(mgr->mgr_ctl_waitq, mgr->mgr_flags & MGR_RUNNING);
+
+ RETURN(0);
+}
+
+
+int llite_ha_cleanup(struct lustre_ha_mgr *mgr)
+{
+ mgr->mgr_flags = MGR_STOPPING;
+
+ wake_up(&mgr->mgr_waitq);
+ wait_event_interruptible(mgr->mgr_ctl_waitq,
+ (mgr->mgr_flags & MGR_STOPPED));
+ return 0;
+}
#include <linux/locks.h>
#include <linux/quotaops.h>
-#define DEBUG_SUBSYSTEM S_LLIGHT
+#define DEBUG_SUBSYSTEM S_LLITE
#include <linux/obd_support.h>
-#include <linux/lustre_light.h>
+#include <linux/lustre_lite.h>
extern struct address_space_operations ll_aops;
/* from super.c */
#include <linux/pagemap.h>
#include <linux/smp_lock.h>
-#define DEBUG_SUBSYSTEM S_LLIGHT
+#define DEBUG_SUBSYSTEM S_LLITE
#include <linux/obd_support.h>
#include <linux/obd_class.h>
#include <linux/lustre_lib.h>
#include <linux/lustre_idl.h>
#include <linux/lustre_mds.h>
-#include <linux/lustre_light.h>
+#include <linux/lustre_lite.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10))
#include <asm/uaccess.h>
#include <asm/segment.h>
-#define DEBUG_SUBSYSTEM S_LLIGHT
+#define DEBUG_SUBSYSTEM S_LLITE
-#include <linux/lustre_light.h>
+#include <linux/lustre_lite.h>
kmem_cache_t *ll_file_data_slab;
extern struct address_space_operations ll_aops;
}
/* the first parameter should become an mds device no */
- err = ptlrpc_connect_client(-1, "mds",
- MDS_REQUEST_PORTAL, MDC_REPLY_PORTAL,
- &sbi->ll_mds_client);
-
+ ptlrpc_init_client(-1, MDS_REQUEST_PORTAL, MDC_REPLY_PORTAL,
+ &sbi->ll_mds_client);
+ err = ptlrpc_connect_client(-1, "mds", &sbi->ll_mds_client);
if (err) {
CERROR("cannot find MDS\n");
GOTO(out_disc, sb = NULL);
}
+
sbi->ll_super = sb;
sbi->ll_rootino = 2;
if (root) {
sb->s_root = d_alloc_root(root);
} else {
- CERROR("lustre_light: bad iget4 for root\n");
+ CERROR("lustre_lite: bad iget4 for root\n");
GOTO(out_req, sb = NULL);
}
MOD_DEC_USE_COUNT;
OBD_FREE(sbi, sizeof(*sbi));
}
- OBD_FREE(device, strlen(device) + 1);
- OBD_FREE(version, strlen(version) + 1);
+ if (device)
+ OBD_FREE(device, strlen(device) + 1);
+ if (version)
+ OBD_FREE(version, strlen(version) + 1);
RETURN(sb);
} /* ll_read_super */
// statfs: ll_statfs
};
-struct file_system_type lustre_light_fs_type = {
- "lustre_light", 0, ll_read_super, NULL
+struct file_system_type lustre_lite_fs_type = {
+ "lustre_lite", 0, ll_read_super, NULL
+};
+
+static int llite_setup(struct obd_device *dev, obd_count len, void *buf)
+{
+ MOD_INC_USE_COUNT;
+ return 0;
+}
+
+static int llite_cleanup(struct obd_device *dev)
+{
+ MOD_DEC_USE_COUNT;
+ return 0;
+}
+
+/* use obd ops to offer management infrastructure */
+static struct obd_ops llite_obd_ops = {
+ o_setup: llite_setup,
+ o_cleanup: llite_cleanup,
};
-static int __init init_lustre_light(void)
+static int __init init_lustre_lite(void)
{
- printk(KERN_INFO "Lustre Light 0.0.1, braam@clusterfs.com\n");
+ printk(KERN_INFO "Lustre Lite 0.0.1, braam@clusterfs.com\n");
+ obd_register_type(&llite_obd_ops, LUSTRE_LITE_NAME);
ll_file_data_slab = kmem_cache_create("ll_file_data",
sizeof(struct ll_file_data), 0,
SLAB_HWCACHE_ALIGN, NULL, NULL);
if (ll_file_data_slab == NULL)
return -ENOMEM;
- return register_filesystem(&lustre_light_fs_type);
+ return register_filesystem(&lustre_lite_fs_type);
}
-static void __exit exit_lustre_light(void)
+static void __exit exit_lustre_lite(void)
{
- unregister_filesystem(&lustre_light_fs_type);
kmem_cache_destroy(ll_file_data_slab);
+ unregister_filesystem(&lustre_lite_fs_type);
+ obd_unregister_type(LUSTRE_LITE_NAME);
}
MODULE_AUTHOR("Peter J. Braam <braam@clusterfs.com>");
-MODULE_DESCRIPTION("Lustre Light Client File System v1.0");
+MODULE_DESCRIPTION("Lustre Lite Client File System v1.0");
MODULE_LICENSE("GPL");
-module_init(init_lustre_light);
-module_exit(exit_lustre_light);
+module_init(init_lustre_lite);
+module_exit(exit_lustre_lite);
* Laboratoire MASI - Institut Blaise Pascal
* Universite Pierre et Marie Curie (Paris VI)
*
- * from
- *
- * linux/fs/minix/symlink.c
- *
* Copyright (C) 1991, 1992 Linus Torvalds
*
* ext2 symlink handling code
#include <linux/stat.h>
#include <linux/locks.h>
-#define DEBUG_SUBSYSTEM S_LLIGHT
+#define DEBUG_SUBSYSTEM S_LLITE
#include <linux/obd_support.h> /* for ENTRY and EXIT only */
-#include <linux/lustre_light.h>
+#include <linux/lustre_lite.h>
static int ll_fast_readlink(struct dentry *dentry, char *buffer, int buflen)
{
struct inode_operations ll_fast_symlink_inode_operations = {
readlink: ll_fast_readlink,
follow_link: ll_fast_follow_link,
- setattr: ll_setattr
+ setattr: ll_setattr
};
extern int mds_queue_req(struct ptlrpc_request *);
+int mdc_connect(struct ptlrpc_client *cl, ino_t ino, int type, int valid,
+ struct ptlrpc_request **request)
+{
+ struct ptlrpc_request *req;
+ struct mds_body *body;
+ int rc, size = sizeof(*body);
+ ENTRY;
+
+ req = ptlrpc_prep_req(cl, MDS_GETATTR, 1, &size, NULL);
+ if (!req)
+ GOTO(out, rc = -ENOMEM);
+
+ body = lustre_msg_buf(req->rq_reqmsg, 0);
+ ll_ino2fid(&body->fid1, ino, 0, type);
+ body->valid = valid;
+
+ req->rq_replen = lustre_msg_size(1, &size);
+
+ rc = ptlrpc_queue_wait(cl, req);
+ rc = ptlrpc_check_status(req, rc);
+
+ if (!rc) {
+ mds_unpack_body(req);
+ body = lustre_msg_buf(req->rq_repmsg, 0);
+ CDEBUG(D_NET, "mode: %o\n", body->mode);
+ }
+
+ EXIT;
+ out:
+ *request = req;
+ return rc;
+}
+
+
int mdc_getattr(struct ptlrpc_client *cl, ino_t ino, int type, int valid,
struct ptlrpc_request **request)
{
RETURN(-EINVAL);
}
- err = ptlrpc_connect_client(-1, "mds",
- MDS_REQUEST_PORTAL, MDC_REPLY_PORTAL, &cl);
+ ptlrpc_init_client(-1, MDS_REQUEST_PORTAL, MDC_REPLY_PORTAL, &cl);
+ err = ptlrpc_connect_client(-1, "mds", &cl);
if (err) {
CERROR("cannot create client\n");
RETURN(-EINVAL);
#define DEBUG_SUBSYSTEM S_OBDFS
#include <linux/obdfs.h>
-#include <linux/lustre_light.h>
+#include <linux/lustre_lite.h>
extern struct address_space_operations obdfs_aops;
/* from super.c */
ino_t obdfs_inode_by_name(struct inode * dir, struct dentry *dentry, int *typ);
int ext2_make_empty(struct inode *inode, struct inode *parent);
struct ext2_dir_entry_2 * ext2_find_entry (struct inode * dir,
- struct dentry *dentry, struct page ** res_page);
+ struct dentry *dentry, struct page ** res_page);
int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page );
int ext2_empty_dir (struct inode * inode);
struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p);
void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de,
- struct page *page, struct inode *inode);
+ struct page *page, struct inode *inode);
/*
* Couple of helper functions - make the code slightly cleaner.
*/
static inline void ext2_inc_count(struct inode *inode)
{
- inode->i_nlink++;
- obdfs_change_inode(inode);
+ inode->i_nlink++;
+ obdfs_change_inode(inode);
}
/* postpone the disk update until the inode really goes away */
static inline void ext2_dec_count(struct inode *inode)
{
- inode->i_nlink--;
- if (inode->i_nlink > 0)
- obdfs_change_inode(inode);
+ inode->i_nlink--;
+ if (inode->i_nlink > 0)
+ obdfs_change_inode(inode);
}
static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode)
{
- int err;
- err = ext2_add_link(dentry, inode);
- if (!err) {
- d_instantiate(dentry, inode);
- return 0;
- }
- ext2_dec_count(inode);
- iput(inode);
- return err;
+ int err;
+ err = ext2_add_link(dentry, inode);
+ if (!err) {
+ d_instantiate(dentry, inode);
+ return 0;
+ }
+ ext2_dec_count(inode);
+ iput(inode);
+ return err;
}
/* methods */
static struct dentry *obdfs_lookup(struct inode * dir, struct dentry *dentry)
{
struct obdo *oa;
- struct inode * inode = NULL;
- int type;
- ino_t ino;
-
+ struct inode * inode = NULL;
+ int type;
+ ino_t ino;
+
ENTRY;
- if (dentry->d_name.len > EXT2_NAME_LEN)
- return ERR_PTR(-ENAMETOOLONG);
+ if (dentry->d_name.len > EXT2_NAME_LEN)
+ return ERR_PTR(-ENAMETOOLONG);
- ino = obdfs_inode_by_name(dir, dentry, &type);
- if (!ino)
- goto negative;
+ ino = obdfs_inode_by_name(dir, dentry, &type);
+ if (!ino)
+ goto negative;
oa = obdo_fromid(IID(dir), ino, type,
- OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS);
+ OBD_MD_FLNOTOBD | OBD_MD_FLBLOCKS);
if ( IS_ERR(oa) ) {
CERROR("obdo_fromid failed\n");
EXIT;
return ERR_PTR(-EACCES);
}
- inode = iget4(dir->i_sb, ino, NULL, oa);
+ inode = iget4(dir->i_sb, ino, NULL, oa);
obdo_free(oa);
- if (!inode)
- return ERR_PTR(-EACCES);
+ if (!inode)
+ return ERR_PTR(-EACCES);
negative:
- d_add(dentry, inode);
- return NULL;
+ d_add(dentry, inode);
+ return NULL;
}
/* Send a hint to the create method on the type of file to create */
oa->o_mode = mode;
oa->o_valid |= OBD_MD_FLMODE;
- CDEBUG(D_INODE, "\n");
+ CDEBUG(D_INODE, "\n");
err = obd_create(IID(dir), oa);
- CDEBUG(D_INODE, "\n");
+ CDEBUG(D_INODE, "\n");
if ( err ) {
CERROR("new_inode - fatal: err %d\n", err);
EXIT;
return ERR_PTR(err);
}
- CDEBUG(D_INODE, "obdo mode %o\n", oa->o_mode);
+ CDEBUG(D_INODE, "obdo mode %o\n", oa->o_mode);
inode = iget4(dir->i_sb, (ino_t)oa->o_id, NULL, oa);
- CDEBUG(D_INODE, "\n");
+ CDEBUG(D_INODE, "\n");
if (!inode) {
CERROR("new_inode -fatal: %ld\n", (long)oa->o_id);
obd_destroy(IID(dir), oa);
- obdo_free(oa);
+ obdo_free(oa);
EXIT;
return ERR_PTR(-EIO);
}
if (!list_empty(&inode->i_dentry)) {
CERROR("new_inode -fatal: aliases %ld, ct %d lnk %d\n",
- (long)oa->o_id,
- atomic_read(&inode->i_count),
- inode->i_nlink);
+ (long)oa->o_id,
+ atomic_read(&inode->i_count),
+ inode->i_nlink);
obd_destroy(IID(dir), oa);
iput(inode);
EXIT;
*/
static int obdfs_create (struct inode * dir, struct dentry * dentry, int mode)
{
- struct inode * inode = obdfs_new_inode (dir, mode);
- int err = PTR_ERR(inode);
- if (!IS_ERR(inode)) {
- inode->i_op = &obdfs_file_inode_operations;
- inode->i_fop = &obdfs_file_operations;
- inode->i_mapping->a_ops = &obdfs_aops;
- err = ext2_add_nondir(dentry, inode);
- }
- return err;
+ struct inode * inode = obdfs_new_inode (dir, mode);
+ int err = PTR_ERR(inode);
+ if (!IS_ERR(inode)) {
+ inode->i_op = &obdfs_file_inode_operations;
+ inode->i_fop = &obdfs_file_operations;
+ inode->i_mapping->a_ops = &obdfs_aops;
+ err = ext2_add_nondir(dentry, inode);
+ }
+ return err;
} /* obdfs_create */
static int obdfs_mknod (struct inode * dir, struct dentry *dentry, int mode, int rdev)
{
- struct inode * inode = obdfs_new_inode (dir, mode);
- int err = PTR_ERR(inode);
- if (!IS_ERR(inode)) {
- init_special_inode(inode, mode, rdev);
- obdfs_change_inode(inode);
- err = ext2_add_nondir(dentry, inode);
- }
- return err;
+ struct inode * inode = obdfs_new_inode (dir, mode);
+ int err = PTR_ERR(inode);
+ if (!IS_ERR(inode)) {
+ init_special_inode(inode, mode, rdev);
+ obdfs_change_inode(inode);
+ err = ext2_add_nondir(dentry, inode);
+ }
+ return err;
}
static int obdfs_symlink (struct inode * dir, struct dentry * dentry,
- const char * symname)
+ const char * symname)
{
- struct super_block * sb = dir->i_sb;
- int err = -ENAMETOOLONG;
- unsigned l = strlen(symname)+1;
- struct inode * inode;
+ struct super_block * sb = dir->i_sb;
+ int err = -ENAMETOOLONG;
+ unsigned l = strlen(symname)+1;
+ struct inode * inode;
struct obdfs_inode_info *oinfo;
- if (l > sb->s_blocksize)
- goto out;
+ if (l > sb->s_blocksize)
+ goto out;
- inode = obdfs_new_inode (dir, S_IFLNK | S_IRWXUGO);
- err = PTR_ERR(inode);
- if (IS_ERR(inode))
- goto out;
+ inode = obdfs_new_inode (dir, S_IFLNK | S_IRWXUGO);
+ err = PTR_ERR(inode);
+ if (IS_ERR(inode))
+ goto out;
oinfo = obdfs_i2info(inode);
if (l >= sizeof(oinfo->oi_inline)) {
- /* slow symlink */
- inode->i_op = &page_symlink_inode_operations;
- inode->i_mapping->a_ops = &obdfs_aops;
- err = block_symlink(inode, symname, l);
- if (err)
- goto out_fail;
- } else {
- /* fast symlink */
- inode->i_op = &obdfs_fast_symlink_inode_operations;
- memcpy(oinfo->oi_inline, symname, l);
- inode->i_size = l-1;
- }
- obdfs_change_inode(inode);
-
- err = ext2_add_nondir(dentry, inode);
+ /* slow symlink */
+ inode->i_op = &page_symlink_inode_operations;
+ inode->i_mapping->a_ops = &obdfs_aops;
+ err = block_symlink(inode, symname, l);
+ if (err)
+ goto out_fail;
+ } else {
+ /* fast symlink */
+ inode->i_op = &obdfs_fast_symlink_inode_operations;
+ memcpy(oinfo->oi_inline, symname, l);
+ inode->i_size = l-1;
+ }
+ obdfs_change_inode(inode);
+
+ err = ext2_add_nondir(dentry, inode);
out:
- return err;
+ return err;
out_fail:
- ext2_dec_count(inode);
- iput (inode);
- goto out;
+ ext2_dec_count(inode);
+ iput (inode);
+ goto out;
}
static int obdfs_link (struct dentry * old_dentry, struct inode * dir,
- struct dentry *dentry)
+ struct dentry *dentry)
{
- struct inode *inode = old_dentry->d_inode;
+ struct inode *inode = old_dentry->d_inode;
- if (S_ISDIR(inode->i_mode))
- return -EPERM;
+ if (S_ISDIR(inode->i_mode))
+ return -EPERM;
- if (inode->i_nlink >= EXT2_LINK_MAX)
- return -EMLINK;
+ if (inode->i_nlink >= EXT2_LINK_MAX)
+ return -EMLINK;
- inode->i_ctime = CURRENT_TIME;
- ext2_inc_count(inode);
- atomic_inc(&inode->i_count);
+ inode->i_ctime = CURRENT_TIME;
+ ext2_inc_count(inode);
+ atomic_inc(&inode->i_count);
- return ext2_add_nondir(dentry, inode);
+ return ext2_add_nondir(dentry, inode);
}
static int obdfs_mkdir(struct inode * dir, struct dentry * dentry, int mode)
{
- struct inode * inode;
- int err = -EMLINK;
- ENTRY;
+ struct inode * inode;
+ int err = -EMLINK;
+ ENTRY;
- if (dir->i_nlink >= EXT2_LINK_MAX)
- goto out;
+ if (dir->i_nlink >= EXT2_LINK_MAX)
+ goto out;
- ext2_inc_count(dir);
+ ext2_inc_count(dir);
- inode = obdfs_new_inode (dir, S_IFDIR | mode);
- err = PTR_ERR(inode);
- if (IS_ERR(inode))
- goto out_dir;
+ inode = obdfs_new_inode (dir, S_IFDIR | mode);
+ err = PTR_ERR(inode);
+ if (IS_ERR(inode))
+ goto out_dir;
- inode->i_op = &obdfs_dir_inode_operations;
- inode->i_fop = &obdfs_dir_operations;
- inode->i_mapping->a_ops = &obdfs_aops;
+ inode->i_op = &obdfs_dir_inode_operations;
+ inode->i_fop = &obdfs_dir_operations;
+ inode->i_mapping->a_ops = &obdfs_aops;
- ext2_inc_count(inode);
+ ext2_inc_count(inode);
- err = ext2_make_empty(inode, dir);
- if (err)
- goto out_fail;
+ err = ext2_make_empty(inode, dir);
+ if (err)
+ goto out_fail;
- err = ext2_add_link(dentry, inode);
- if (err)
- goto out_fail;
+ err = ext2_add_link(dentry, inode);
+ if (err)
+ goto out_fail;
- d_instantiate(dentry, inode);
+ d_instantiate(dentry, inode);
out:
- EXIT;
- return err;
+ EXIT;
+ return err;
out_fail:
- ext2_dec_count(inode);
- ext2_dec_count(inode);
- iput(inode);
- EXIT;
+ ext2_dec_count(inode);
+ ext2_dec_count(inode);
+ iput(inode);
+ EXIT;
out_dir:
- ext2_dec_count(dir);
- EXIT;
- goto out;
+ ext2_dec_count(dir);
+ EXIT;
+ goto out;
}
static int obdfs_unlink(struct inode * dir, struct dentry *dentry)
{
- struct inode * inode = dentry->d_inode;
- struct ext2_dir_entry_2 * de;
- struct page * page;
- int err = -ENOENT;
-
- de = ext2_find_entry (dir, dentry, &page);
- if (!de)
- goto out;
-
- err = ext2_delete_entry (de, page);
- if (err)
- goto out;
-
- inode->i_ctime = dir->i_ctime;
- ext2_dec_count(inode);
- err = 0;
+ struct inode * inode = dentry->d_inode;
+ struct ext2_dir_entry_2 * de;
+ struct page * page;
+ int err = -ENOENT;
+
+ de = ext2_find_entry (dir, dentry, &page);
+ if (!de)
+ goto out;
+
+ err = ext2_delete_entry (de, page);
+ if (err)
+ goto out;
+
+ inode->i_ctime = dir->i_ctime;
+ ext2_dec_count(inode);
+ err = 0;
out:
- return err;
+ return err;
}
static int obdfs_rmdir (struct inode * dir, struct dentry *dentry)
{
- struct inode * inode = dentry->d_inode;
- int err = -ENOTEMPTY;
-
- if (ext2_empty_dir(inode)) {
- err = obdfs_unlink(dir, dentry);
- if (!err) {
- inode->i_size = 0;
- ext2_dec_count(inode);
- ext2_dec_count(dir);
- }
- }
- return err;
+ struct inode * inode = dentry->d_inode;
+ int err = -ENOTEMPTY;
+
+ if (ext2_empty_dir(inode)) {
+ err = obdfs_unlink(dir, dentry);
+ if (!err) {
+ inode->i_size = 0;
+ ext2_dec_count(inode);
+ ext2_dec_count(dir);
+ }
+ }
+ return err;
}
static int obdfs_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 )
{
- struct inode * old_inode = old_dentry->d_inode;
- struct inode * new_inode = new_dentry->d_inode;
- struct page * dir_page = NULL;
- struct ext2_dir_entry_2 * dir_de = NULL;
- struct page * old_page;
- struct ext2_dir_entry_2 * old_de;
- int err = -ENOENT;
-
- old_de = ext2_find_entry (old_dir, old_dentry, &old_page);
- if (!old_de)
- goto out;
-
- if (S_ISDIR(old_inode->i_mode)) {
- err = -EIO;
- dir_de = ext2_dotdot(old_inode, &dir_page);
- if (!dir_de)
- goto out_old;
- }
-
- if (new_inode) {
- struct page *new_page;
- struct ext2_dir_entry_2 *new_de;
-
- err = -ENOTEMPTY;
- if (dir_de && !ext2_empty_dir (new_inode))
- goto out_dir;
-
- err = -ENOENT;
- new_de = ext2_find_entry (new_dir, new_dentry, &new_page);
- if (!new_de)
- goto out_dir;
- ext2_inc_count(old_inode);
- ext2_set_link(new_dir, new_de, new_page, old_inode);
- new_inode->i_ctime = CURRENT_TIME;
- if (dir_de)
- new_inode->i_nlink--;
- ext2_dec_count(new_inode);
- } else {
- if (dir_de) {
- err = -EMLINK;
- if (new_dir->i_nlink >= EXT2_LINK_MAX)
- goto out_dir;
- }
- ext2_inc_count(old_inode);
- err = ext2_add_link(new_dentry, old_inode);
- if (err) {
- ext2_dec_count(old_inode);
- goto out_dir;
- }
- if (dir_de)
- ext2_inc_count(new_dir);
- }
-
- ext2_delete_entry (old_de, old_page);
- ext2_dec_count(old_inode);
-
- if (dir_de) {
- ext2_set_link(old_inode, dir_de, dir_page, new_dir);
- ext2_dec_count(old_dir);
- }
- return 0;
+ struct inode * old_inode = old_dentry->d_inode;
+ struct inode * new_inode = new_dentry->d_inode;
+ struct page * dir_page = NULL;
+ struct ext2_dir_entry_2 * dir_de = NULL;
+ struct page * old_page;
+ struct ext2_dir_entry_2 * old_de;
+ int err = -ENOENT;
+
+ old_de = ext2_find_entry (old_dir, old_dentry, &old_page);
+ if (!old_de)
+ goto out;
+
+ if (S_ISDIR(old_inode->i_mode)) {
+ err = -EIO;
+ dir_de = ext2_dotdot(old_inode, &dir_page);
+ if (!dir_de)
+ goto out_old;
+ }
+
+ if (new_inode) {
+ struct page *new_page;
+ struct ext2_dir_entry_2 *new_de;
+
+ err = -ENOTEMPTY;
+ if (dir_de && !ext2_empty_dir (new_inode))
+ goto out_dir;
+
+ err = -ENOENT;
+ new_de = ext2_find_entry (new_dir, new_dentry, &new_page);
+ if (!new_de)
+ goto out_dir;
+ ext2_inc_count(old_inode);
+ ext2_set_link(new_dir, new_de, new_page, old_inode);
+ new_inode->i_ctime = CURRENT_TIME;
+ if (dir_de)
+ new_inode->i_nlink--;
+ ext2_dec_count(new_inode);
+ } else {
+ if (dir_de) {
+ err = -EMLINK;
+ if (new_dir->i_nlink >= EXT2_LINK_MAX)
+ goto out_dir;
+ }
+ ext2_inc_count(old_inode);
+ err = ext2_add_link(new_dentry, old_inode);
+ if (err) {
+ ext2_dec_count(old_inode);
+ goto out_dir;
+ }
+ if (dir_de)
+ ext2_inc_count(new_dir);
+ }
+
+ ext2_delete_entry (old_de, old_page);
+ ext2_dec_count(old_inode);
+
+ if (dir_de) {
+ ext2_set_link(old_inode, dir_de, dir_page, new_dir);
+ ext2_dec_count(old_dir);
+ }
+ return 0;
out_dir:
- if (dir_de) {
- kunmap(dir_page);
- page_cache_release(dir_page);
- }
+ if (dir_de) {
+ kunmap(dir_page);
+ page_cache_release(dir_page);
+ }
out_old:
- kunmap(old_page);
- page_cache_release(old_page);
+ kunmap(old_page);
+ page_cache_release(old_page);
out:
- return err;
+ return err;
}
struct inode_operations obdfs_dir_inode_operations = {
- create: obdfs_create,
- lookup: obdfs_lookup,
- link: obdfs_link,
- unlink: obdfs_unlink,
- symlink: obdfs_symlink,
- mkdir: obdfs_mkdir,
- rmdir: obdfs_rmdir,
- mknod: obdfs_mknod,
- rename: obdfs_rename,
- setattr: obdfs_setattr
+ create: obdfs_create,
+ lookup: obdfs_lookup,
+ link: obdfs_link,
+ unlink: obdfs_unlink,
+ symlink: obdfs_symlink,
+ mkdir: obdfs_mkdir,
+ rmdir: obdfs_rmdir,
+ mknod: obdfs_mknod,
+ rename: obdfs_rename,
+ setattr: obdfs_setattr
};
if (osc->osc_client == NULL)
RETURN(-ENOMEM);
- rc = ptlrpc_connect_client(dev, "ost",
- OST_REQUEST_PORTAL, OSC_REPLY_PORTAL,
+ ptlrpc_init_client(dev, OST_REQUEST_PORTAL, OSC_REPLY_PORTAL,
osc->osc_client);
+ rc = ptlrpc_connect_client(dev, "ost", osc->osc_client);
if (rc == 0)
MOD_INC_USE_COUNT;
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
+#include <linux/list.h>
#define DEBUG_SUBSYSTEM S_RPC
#include <linux/obd_class.h>
#include <linux/lustre_net.h>
-int ptlrpc_enqueue(struct ptlrpc_client *peer, struct ptlrpc_request *req)
-{
- struct ptlrpc_request *srv_req;
-
- if (!peer->cli_obd)
- RETURN(-1);
-
- OBD_ALLOC(srv_req, sizeof(*srv_req));
- if (!srv_req)
- RETURN(-ENOMEM);
-
- CDEBUG(0, "peer obd minor %d, incoming req %p, srv_req %p\n",
- peer->cli_obd->obd_minor, req, srv_req);
-
- /* move the request buffer */
- srv_req->rq_reqbuf = req->rq_reqbuf;
- srv_req->rq_reqlen = req->rq_reqlen;
- srv_req->rq_obd = peer->cli_obd;
-
- /* remember where it came from */
- srv_req->rq_reply_handle = req;
-
- spin_lock(&peer->cli_lock);
- list_add(&srv_req->rq_list, &peer->cli_obd->obd_req_list);
- spin_unlock(&peer->cli_lock);
- wake_up(&peer->cli_obd->obd_req_waitq);
- return 0;
-}
-
-int ptlrpc_connect_client(int dev, char *uuid, int req_portal, int rep_portal,
+void ptlrpc_init_client(int dev, int req_portal, int rep_portal,
struct ptlrpc_client *cl)
{
- int err;
-
memset(cl, 0, sizeof(*cl));
spin_lock_init(&cl->cli_lock);
cl->cli_xid = 1;
+ cl->cli_generation = 1;
+ cl->cli_epoch = 1;
+ cl->cli_bootcount = 0;
cl->cli_obd = NULL;
cl->cli_request_portal = req_portal;
cl->cli_reply_portal = rep_portal;
+ INIT_LIST_HEAD(&cl->cli_sending_head);
+ INIT_LIST_HEAD(&cl->cli_sent_head);
sema_init(&cl->cli_rpc_sem, 32);
+}
- /* non networked client */
- if (dev >= 0 && dev < MAX_OBD_DEVICES) {
- struct obd_device *obd = &obd_dev[dev];
-
- if ((!obd->obd_flags & OBD_ATTACHED) ||
- (!obd->obd_flags & OBD_SET_UP)) {
- CERROR("target device %d not att or setup\n", dev);
- return -EINVAL;
- }
- if (strcmp(obd->obd_type->typ_name, "ost") &&
- strcmp(obd->obd_type->typ_name, "mds"))
- return -EINVAL;
-
- cl->cli_obd = &obd_dev[dev];
- return 0;
- }
+int ptlrpc_connect_client(int dev, char *uuid, struct ptlrpc_client *cl)
+{
+ int err;
- /* networked */
+ cl->cli_epoch++;
err = kportal_uuid_to_peer(uuid, &cl->cli_server);
if (err != 0)
CERROR("cannot find peer %s!\n", uuid);
RETURN(0);
}
+static void ptlrpc_cleanup_request_buf(struct ptlrpc_request *request)
+{
+ OBD_FREE(request->rq_reqbuf, request->rq_reqlen);
+ request->rq_reqbuf = NULL;
+ request->rq_reqlen = 0;
+}
+
/* Abort this request and cleanup any resources associated with it. */
-int ptlrpc_abort(struct ptlrpc_request *request)
+static int ptlrpc_abort(struct ptlrpc_request *request)
{
/* First remove the ME for the reply; in theory, this means
* that we can tear down the buffer safely. */
OBD_FREE(request->rq_reply_md.start, request->rq_replen);
request->rq_repbuf = NULL;
request->rq_replen = 0;
-
return 0;
}
init_waitqueue_head(&req->rq_wait_for_rep);
- if (cl->cli_obd) {
- /* Local delivery */
- down(&cl->cli_rpc_sem);
- rc = ptlrpc_enqueue(cl, req);
- } else {
- /* Remote delivery via portals. */
- req->rq_req_portal = cl->cli_request_portal;
- req->rq_reply_portal = cl->cli_reply_portal;
- rc = ptl_send_rpc(req, cl);
- }
+ req->rq_client = cl;
+ req->rq_req_portal = cl->cli_request_portal;
+ req->rq_reply_portal = cl->cli_reply_portal;
+ rc = ptl_send_rpc(req, cl);
if (rc) {
CERROR("error %d, opcode %d\n", rc, req->rq_reqmsg->opc);
+ ptlrpc_cleanup_request_buf(req);
up(&cl->cli_rpc_sem);
RETURN(-rc);
}
CDEBUG(D_OTHER, "-- sleeping\n");
wait_event_interruptible(req->rq_wait_for_rep, ptlrpc_check_reply(req));
CDEBUG(D_OTHER, "-- done\n");
+ ptlrpc_cleanup_request_buf(req);
up(&cl->cli_rpc_sem);
if (req->rq_flags == PTL_RPC_INTR) {
/* Clean up the dangling reply buffers */
#include <linux/obd_class.h>
#include <linux/lustre_net.h>
-ptl_handle_eq_t sent_pkt_eq, rcvd_rep_eq, bulk_source_eq, bulk_sink_eq;
+ptl_handle_eq_t request_out_eq,
+ reply_in_eq,
+ reply_out_eq,
+ bulk_source_eq,
+ bulk_sink_eq;
static const ptl_handle_ni_t *socknal_nip = NULL, *qswnal_nip = NULL;
/*
* Free the packet when it has gone out
*/
-static int sent_packet_callback(ptl_event_t *ev, void *data)
+static int request_out_callback(ptl_event_t *ev, void *data)
+{
+ struct ptlrpc_request *req = ev->mem_desc.user_ptr;
+ struct ptlrpc_client *cl = req->rq_client;
+
+ ENTRY;
+
+ if (ev->type == PTL_EVENT_SENT) {
+ list_del(&req->rq_list);
+ list_add(&req->rq_list, &cl->cli_sent_head);
+ } else {
+ // XXX make sure we understand all events, including ACK's
+ CERROR("Unknown event %d\n", ev->type);
+ LBUG();
+ }
+
+ RETURN(1);
+}
+
+
+/*
+ * Free the packet when it has gone out
+ */
+static int reply_out_callback(ptl_event_t *ev, void *data)
{
ENTRY;
/*
* Wake up the thread waiting for the reply once it comes in.
*/
-static int rcvd_reply_callback(ptl_event_t *ev, void *data)
+static int reply_in_callback(ptl_event_t *ev, void *data)
{
struct ptlrpc_request *rpc = ev->mem_desc.user_ptr;
ENTRY;
RETURN(1);
}
-int server_request_callback(ptl_event_t *ev, void *data)
+int request_in_callback(ptl_event_t *ev, void *data)
{
struct ptlrpc_service *service = data;
int index;
else
ni = *socknal_nip;
- rc = PtlEQAlloc(ni, 128, sent_packet_callback, NULL, &sent_pkt_eq);
+ rc = PtlEQAlloc(ni, 128, request_out_callback, NULL, &request_out_eq);
+ if (rc != PTL_OK)
+ CERROR("PtlEQAlloc failed: %d\n", rc);
+
+ rc = PtlEQAlloc(ni, 128, reply_out_callback, NULL, &reply_out_eq);
if (rc != PTL_OK)
CERROR("PtlEQAlloc failed: %d\n", rc);
- rc = PtlEQAlloc(ni, 128, rcvd_reply_callback, NULL, &rcvd_rep_eq);
+ rc = PtlEQAlloc(ni, 128, reply_in_callback, NULL, &reply_in_eq);
if (rc != PTL_OK)
CERROR("PtlEQAlloc failed: %d\n", rc);
void ptlrpc_exit_portals(void)
{
- PtlEQFree(sent_pkt_eq);
- PtlEQFree(rcvd_rep_eq);
+ PtlEQFree(request_out_eq);
+ PtlEQFree(reply_out_eq);
+ PtlEQFree(reply_in_eq);
PtlEQFree(bulk_source_eq);
PtlEQFree(bulk_sink_eq);
#include <linux/obd_class.h>
#include <linux/lustre_net.h>
-extern ptl_handle_eq_t bulk_source_eq, sent_pkt_eq, rcvd_rep_eq, bulk_sink_eq;
+extern ptl_handle_eq_t request_out_eq,
+ reply_in_eq,
+ reply_out_eq,
+ bulk_source_eq,
+ bulk_sink_eq;
static ptl_process_id_t local_id = {PTL_ID_ANY, PTL_ID_ANY};
ptl_handle_md_t md_h;
ptl_ack_req_t ack;
+ request->rq_req_md.user_ptr = request;
+
switch (request->rq_type) {
case PTL_RPC_BULK:
request->rq_req_md.start = request->rq_bulkbuf;
case PTL_RPC_REQUEST:
request->rq_req_md.start = request->rq_reqbuf;
request->rq_req_md.length = request->rq_reqlen;
- request->rq_req_md.eventq = sent_pkt_eq;
+ request->rq_req_md.eventq = request_out_eq;
request->rq_req_md.threshold = 1;
ack = PTL_NOACK_REQ;
break;
case PTL_RPC_REPLY:
request->rq_req_md.start = request->rq_repbuf;
request->rq_req_md.length = request->rq_replen;
- request->rq_req_md.eventq = sent_pkt_eq;
+ request->rq_req_md.eventq = reply_out_eq;
request->rq_req_md.threshold = 1;
ack = PTL_NOACK_REQ;
break;
request->rq_reply_md.threshold = 1;
request->rq_reply_md.options = PTL_MD_OP_PUT;
request->rq_reply_md.user_ptr = request;
- request->rq_reply_md.eventq = rcvd_rep_eq;
+ request->rq_reply_md.eventq = reply_in_eq;
rc = PtlMDAttach(request->rq_reply_me_h, request->rq_reply_md,
PTL_UNLINK, &request->rq_reply_md_h);
CDEBUG(D_NET, "Setup reply buffer: %u bytes, xid %u, portal %u\n",
request->rq_replen, request->rq_xid, request->rq_reply_portal);
+ list_add(&request->rq_list, &cl->cli_sending_head);
rc = ptl_send_buf(request, &cl->cli_server, request->rq_req_portal);
RETURN(rc);
#include <linux/obd_class.h>
#include <linux/lustre_net.h>
-extern int server_request_callback(ptl_event_t *ev, void *data);
+extern int request_in_callback(ptl_event_t *ev, void *data);
extern int ptl_handled_rpc(struct ptlrpc_service *service, void *start);
static int ptlrpc_check_event(struct ptlrpc_service *svc)
service->srv_id.pid = PTL_ID_ANY;
rc = PtlEQAlloc(service->srv_self.peer_ni, 128,
- server_request_callback,
+ request_in_callback,
service, &(service->srv_eq_h));
if (rc != PTL_OK) {
insmod $SRCDIR/../../obd/obdecho/obdecho.o || exit -1
insmod $SRCDIR/../../obd/mds/mds.o || exit -1
insmod $SRCDIR/../../obd/mdc/mdc.o || exit -1
- insmod $SRCDIR/../../obd/llight/llight.o || exit -1
+ insmod $SRCDIR/../../obd/llight/llite.o || exit -1
list_mods
- [ -d /mnt/obd ] || mkdir /mnt/obd
+ [ -d /mnt/lustre ] || mkdir /mnt/lustre
}
setup_portals() {
quit
EOF
-mount -t lustre_light -o device=3 none /mnt/obd
+mount -t lustre_lite -o device=3 none /mnt/lustre
quit
EOF
-# mount -t lustre_light -o device=3 none /mnt/obd
+# mount -t lustre_lite -o device=3 none /mnt/lustre
quit
EOF
-mkdir /mnt/obd
-mount -t lustre_light -o device=0 none /mnt/obd
+mkdir /mnt/lustre
+mount -t lustre_lite -o device=0 none /mnt/lustre
quit
EOF
-mount -t lustre_light -o device=3 none /mnt/obd
+mount -t lustre_lite -o device=3 none /mnt/lustre
SRCDIR="`dirname $0`"
. $SRCDIR/common.sh
-umount /mnt/obd
+umount /mnt/lustre
killall acceptor
-rmmod llight
+rmmod llite
rmmod mdc
$OBDCTL <<EOF
quit
EOF
-mount -t lustre_light -o device=3 none /mnt/obd
+mount -t lustre_lite -o device=3 none /mnt/lustre
quit
EOF
-mount -t lustre_light -o device=3 none /mnt/obd
+mount -t lustre_lite -o device=3 none /mnt/lustre
SRCDIR="`dirname $0`"
. $SRCDIR/common.sh
-rmmod llight
+rmmod llite
rmmod mdc
$OBDCTL <<EOF
#!/bin/sh
[ -e /proc/sys/portals/debug ] && echo 0 > /proc/sys/portals/debug
-cd /mnt/obd
+cd /mnt/lustre
cp /usr/src/obd/demos/dbench/client.txt .
/usr/src/obd/demos/dbench/dbench $1
quit
EOF
-MOUNT='mount -t lustre_light -o device=3 none /mnt/obd'
+MOUNT='mount -t lustre_lite -o device=3 none /mnt/lustre'
$MOUNT
test_fail() {
$*
echo "Cleaning up and restarting MDS"
- umount /mnt/obd
+ umount /mnt/lustre
$OBDCTL <<- EOF
device 0
cleanup
#set -vx
-touch /mnt/obd/foo
-chmod a+x /mnt/obd/foo
+touch /mnt/lusre/foo
+chmod a+x /mnt/lustre/foo
sync
# OBD_FAIL_MDS_REINT_SETATTR_WRITE - MDS will discard data from setattr
-test_fail 0x10a chmod 000 /mnt/obd/foo
-ls -l /mnt/obd/foo
-[ ! -x /mnt/obd/foo ] && echo "/mnt/obd/foo is not executable!" 1>&2 && exit -1
+test_fail 0x10a chmod 000 /mnt/lustre/foo
+ls -l /mnt/lustre/foo
+[ ! -x /mnt/lustre/foo ] && echo "/mnt/lustre/foo is not executable!" 1>&2 && exit -1
# OBD_FAIL_MDS_REINT_CREATE_WRITE - MDS will not create the file
-test_fail 0x10c touch /mnt/obd/bar
-ls /mnt/obd/bar
-[ $? -eq 0 ] && echo "/mnt/obd/bar was created!" 1>&2 && exit -1
+test_fail 0x10c touch /mnt/lustre/bar
+ls /mnt/lustre/bar
+[ $? -eq 0 ] && echo "/mnt/lustre/bar was created!" 1>&2 && exit -1
# OBD_FAIL_MDS_REINT_UNLINK_WRITE - MDS will discard data from unlink
-test_fail 0x10e rm /mnt/obd/foo
-ls /mnt/obd/foo
-[ $? -eq 1 ] && echo "/mnt/obd/foo has been removed!" 1>&2 && exit -1
+test_fail 0x10e rm /mnt/lustre/foo
+ls /mnt/lustre/foo
+[ $? -eq 1 ] && echo "/mnt/lustre/foo has been removed!" 1>&2 && exit -1
# OBD_FAIL_MDS_REINT_RENAME_WRITE - MDS will discard data from rename
-test_fail 0x112 mv /mnt/obd/foo /mnt/obd/bar
-ls /mnt/obd/foo /mnt/obd/bar
-[ ! -f /mnt/obd/foo -o -f /mnt/obd/bar ] && \
- echo "/mnt/obd/foo has been renamed to bar!" 1>&2 && exit -1
+test_fail 0x112 mv /mnt/lustre/foo /mnt/lustre/bar
+ls /mnt/lustre/foo /mnt/lustre/bar
+[ ! -f /mnt/lustre/foo -o -f /mnt/lustre/bar ] && \
+ echo "/mnt/lustre/foo has been renamed to bar!" 1>&2 && exit -1
echo "Done."
kill -9 $!
echo 0 > /proc/sys/lustre/fail_loc
- umount /mnt/obd
- mount -t lustre_light -o device=3 none /mnt/obd
+ umount /mnt/lustre
+ mount -t lustre_lite -o device=3 none /mnt/lustre
}
mknod /dev/request c 10 244
sh llmount.sh
# GETATTR_NET - ls will hang on the getattr
-run 0x102 ls -l /mnt/obd
+run 0x102 ls -l /mnt/lustre
# READPAGE_NET - ls will hang reading in new pages (lost+found is not in cache)
-run 0x104 ls /mnt/obd
+run 0x104 ls /mnt/lustre
sleep 1
# REINT_NET - touch will hang on setattr
-run 0x107 touch /mnt/obd
+run 0x107 touch /mnt/lustre
# REINT_NET - touch will hang on create
-run 0x107 touch /mnt/obd/tt
+run 0x107 touch /mnt/lustre/tt
# REINT_NET - mv will hang on rename
-touch /mnt/obd/foo
-run 0x107 mv /mnt/obd/foo /mnt/obd/bar
+touch /mnt/lustre/foo
+run 0x107 mv /mnt/lustre/foo /mnt/lustre/bar
# REINT_NET - rm will hang on unlink
-touch /mnt/obd/salmon
-run 0x107 rm /mnt/obd/salmon
+touch /mnt/lustre/salmon
+run 0x107 rm /mnt/lustre/salmon
# OPEN_NET - touch will hang on open
-touch /mnt/obd/foo
-run 0x113 cat /mnt/obd/foo
+touch /mnt/lustre/foo
+run 0x113 cat /mnt/lustre/foo
# CLOSE_NET - ls will hang on close
run 0x115 ./testreq --close junk_file_handle
rm -f endiozone
while date; do
echo "Test #$COUNT"
- iozone -i 0 -i 1 -f /mnt/obd/test.$$ -s $SIZE 2>&1 || exit $?
+ iozone -i 0 -i 1 -f /mnt/lusre/test.$$ -s $SIZE 2>&1 || exit $?
COUNT=`expr $COUNT + 1`
[ -f endiozone ] && rm endiozone && exit 0
done | tee /tmp/iozone.log
llmount.sh || exit 1
# let's start slowly here...
-touch /mnt/obd || exit 2
-cp /etc/hosts /mnt/obd || exit 3
-diff -u /etc/hosts /mnt/obd/hosts || exit 4
+touch /mnt/lustre || exit 2
+cp /etc/hosts /mnt/lustre || exit 3
+diff -u /etc/hosts /mnt/lustre/hosts || exit 4
# ok, that hopefully worked, so let's do a little more
FILES=`find /etc -type f`
-echo "copying files from /etc to /mnt/obd"
-tar cf - $FILES | tar xf - -C /mnt/obd || exit 10
+echo "copying files from /etc to /mnt/lustre"
+tar cf - $FILES | tar xf - -C /mnt/lustre || exit 10
echo "comparing newly copied files"
for f in $FILES; do
- diff -q $f /mnt/obd/$f || ERROR=11
+ diff -q $f /mnt/lustre/$f || ERROR=11
done
[ "$ERROR" ] && exit $ERROR
llrmount.sh || exit 20
echo "comparing previously copied files"
-diff -u /etc/hosts /mnt/obd/hosts || exit 21
+diff -u /etc/hosts /mnt/lustre/hosts || exit 21
for f in $FILES; do
- diff -q $f /mnt/obd/$f || ERROR=22
+ diff -q $f /mnt/lustre/$f || ERROR=22
done
[ "$ERROR" ] && exit $ERROR
-rm /mnt/obd/hosts || exit 23
+rm /mnt/lustre/hosts || exit 23
-rm -r /mnt/obd/etc || exit 24
+rm -r /mnt/lustre/etc || exit 24
llmountcleanup.sh