From 04190b5f6540c8c6adb8f931ba133fc9683fe641 Mon Sep 17 00:00:00 2001 From: braam Date: Wed, 6 Feb 2002 18:25:41 +0000 Subject: [PATCH] Minor cleanups and debugging statements added. --- lustre/llite/rw.c | 2 +- lustre/llite/super.c | 29 +++++++++++++++++++++++++---- lustre/mdc/mdc_request.c | 1 + lustre/tests/lllocalmount.sh | 20 +++++++++++++++----- lustre/tests/llmount.sh | 19 +++++++++++++------ lustre/tests/llmountcleanup.sh | 12 ++++++++++++ lustre/tests/mdcreqcleanup.sh | 2 +- 7 files changed, 68 insertions(+), 17 deletions(-) diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index a109efd..0cb0eab 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -269,7 +269,7 @@ int ll_dir_readpage(struct file *file, struct page *page) buf = kmap(page); rc = mdc_readpage(sbi->ll_peer_ptr, inode->i_ino, S_IFDIR, offset, buf, NULL, &hdr); - kunmap(buff); + kunmap(page); if ( rc ) { EXIT; goto readpage_out; diff --git a/lustre/llite/super.c b/lustre/llite/super.c index 337d1e0..ffcd06a 100644 --- a/lustre/llite/super.c +++ b/lustre/llite/super.c @@ -47,13 +47,17 @@ static char *ll_read_opt(const char *opt, char *data) { char *value; char *retval; + ENTRY; CDEBUG(D_INFO, "option: %s, data %s\n", opt, data); - if ( strncmp(opt, data, strlen(opt)) ) + if ( strncmp(opt, data, strlen(opt)) ) { + EXIT; return NULL; - - if ( (value = strchr(data, '=')) == NULL ) + } + if ( (value = strchr(data, '=')) == NULL ) { + EXIT; return NULL; + } value++; OBD_ALLOC(retval, char *, strlen(value) + 1); @@ -64,15 +68,19 @@ static char *ll_read_opt(const char *opt, char *data) memcpy(retval, value, strlen(value)+1); CDEBUG(D_PSDEV, "Assigned option: %s, value %s\n", opt, retval); + EXIT; return retval; } static void ll_options(char *options, char **dev, char **vers) { char *this_char; + ENTRY; - if (!options) + if (!options) { + EXIT; return; + } for (this_char = strtok (options, ","); this_char != NULL; @@ -83,6 +91,7 @@ static void ll_options(char *options, char **dev, char **vers) continue; } + EXIT; } static struct super_block * ll_read_super(struct super_block *sb, @@ -103,12 +112,16 @@ static struct super_block * ll_read_super(struct super_block *sb, memset(sbi, 0, sizeof(*sbi)); + printk(__FUNCTION__ "line %d\n", __LINE__); + ll_options(data, &device, &version); + printk(__FUNCTION__ "line %d\n", __LINE__); if ( !device ) { printk(__FUNCTION__ ": no device\n"); sb = NULL; goto ERR; } + printk(__FUNCTION__ "line %d\n", __LINE__); devno = simple_strtoul(device, NULL, 0); if ( devno >= MAX_OBD_DEVICES ) { @@ -116,6 +129,7 @@ static struct super_block * ll_read_super(struct super_block *sb, sb = NULL; goto ERR; } + printk(__FUNCTION__ "line %d\n", __LINE__); sbi->ll_conn.oc_dev = &obd_dev[devno]; err = obd_connect(&sbi->ll_conn); @@ -124,11 +138,14 @@ static struct super_block * ll_read_super(struct super_block *sb, sb = NULL; goto ERR; } + printk(__FUNCTION__ "line %d\n", __LINE__); connected = 1; + printk(__FUNCTION__ "line %d\n", __LINE__); err = kportal_uuid_to_peer("mds", &sbi->ll_peer); if (err == 0) sbi->ll_peer_ptr = &sbi->ll_peer; + printk(__FUNCTION__ "line %d\n", __LINE__); sbi->ll_super = sb; sbi->ll_rootino = 2; @@ -138,16 +155,19 @@ static struct super_block * ll_read_super(struct super_block *sb, sb->s_blocksize_bits = (unsigned char)PAGE_SHIFT; sb->s_magic = LL_SUPER_MAGIC; sb->s_op = &ll_super_operations; + printk(__FUNCTION__ "line %d\n", __LINE__); /* make root inode */ err = mdc_getattr(sbi->ll_peer_ptr, sbi->ll_rootino, S_IFDIR, OBD_MD_FLNOTOBD|OBD_MD_FLBLOCKS, &rep, &hdr); + printk(__FUNCTION__ "line %d\n", __LINE__); if (err) { printk(__FUNCTION__ ": mds_getattr failed for root %d\n", err); sb = NULL; goto ERR; } + printk(__FUNCTION__ "line %d\n", __LINE__); root = iget4(sb, sbi->ll_rootino, NULL, rep); if (root) { @@ -157,6 +177,7 @@ static struct super_block * ll_read_super(struct super_block *sb, sb = NULL; goto ERR; } + printk(__FUNCTION__ "line %d\n", __LINE__); ERR: if (hdr) diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index fba4cc1..654275f 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -79,6 +79,7 @@ static int mds_queue_wait(struct ptlrpc_request *req, struct lustre_peer *peer) /* XXX fix the race here (wait_for_event?)*/ if (peer == NULL) { /* Local delivery */ + printk("--->> %s %d\n", __FUNCTION__, __LINE__); rc = mds_queue_req(req); } else { /* Remote delivery via portals. */ diff --git a/lustre/tests/lllocalmount.sh b/lustre/tests/lllocalmount.sh index 70b5400..d562351 100755 --- a/lustre/tests/lllocalmount.sh +++ b/lustre/tests/lllocalmount.sh @@ -1,6 +1,14 @@ #!/bin/sh -R=/r +#R=/r +LOOP0=/dev/loop0 +LOOP1=/dev/loop1 + +if [ ! -e $LOOP0 ]; then + echo $LOOP0 doesnt exist: not using devfs? + exit +fi + mknod /dev/portals c 10 240 @@ -20,21 +28,23 @@ insmod $R/usr/src/obd/llight/llight.o dd if=/dev/zero of=/tmp/ost bs=1024 count=10000 mke2fs -b 4096 -F /tmp/ost -losetup /dev/loop/0 /tmp/ost +losetup $LOOP0 /tmp/ost dd if=/dev/zero of=/tmp/mds bs=1024 count=10000 mke2fs -b 4096 -F /tmp/mds -losetup /dev/loop/1 /tmp/mds +losetup $LOOP1 /tmp/mds mknod /dev/obd c 10 241 +echo 8291 > /proc/sys/obd/debug +echo 8291 > /proc/sys/obd/trace $R/usr/src/obd/utils/obdctl < /proc/sys/obd/debug +echo 8291 > /proc/sys/obd/trace $R/usr/src/obd/utils/obdctl <