From d8b0dffb5c369fc94fccdeeb689e6405836d0cd2 Mon Sep 17 00:00:00 2001 From: braam Date: Thu, 25 Jul 2002 21:35:24 +0000 Subject: [PATCH] Fix some simple errors and warnings - LOV's mount again. - set some unitialized variables to 0 --- lustre/archdep.m4 | 2 +- lustre/llite/namei.c | 4 ++-- lustre/lov/lov_obd.c | 4 ++-- lustre/mds/handler.c | 2 +- lustre/mds/mds_lov.c | 6 +++--- lustre/obdclass/class_obd.c | 4 ++-- lustre/obdfilter/filter.c | 5 ++--- lustre/utils/Makefile.am | 2 +- lustre/utils/device.c | 6 +++--- lustre/utils/lconf | 2 +- lustre/utils/lctl.c | 2 +- lustre/utils/obdctl.c | 2 +- 12 files changed, 20 insertions(+), 21 deletions(-) diff --git a/lustre/archdep.m4 b/lustre/archdep.m4 index ab02cd9..9f7198d 100644 --- a/lustre/archdep.m4 +++ b/lustre/archdep.m4 @@ -15,7 +15,7 @@ AC_MSG_CHECKING(setting make flags system architecture: ) case ${host_cpu} in um ) AC_MSG_RESULT($host_cpu) - KCFLAGS='-g -Wall -pipe -Wno-trigraphs -Wstrict-prototypes -fno-strict-aliasing -fno-common ' + KCFLAGS='-g -Wall -pipe -Wno-trigraphs -Wstrict-prototypes -fno-strict-aliasing -fno-common ' KCPPFLAGS='-D__KERNEL__ -U__i386__ -Ui386 -DUM_FASTCALL -D__arch_um__ -DSUBARCH="i386" -DNESTING=0 -D_LARGEFILE64_SOURCE -Derrno=kernel_errno -DPATCHLEVEL=4 -DMODULE -I$(LINUX)/arch/um/include ' MOD_LINK=elf_i386 ;; diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 640abf6..1ed4375 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -138,7 +138,7 @@ static struct dentry *ll_lookup2(struct inode * dir, struct dentry *dentry, struct lustre_handle lockh; int err, type, offset; struct lookup_intent lookup_it = { IT_LOOKUP }; - obd_id ino; + obd_id ino = 0; ENTRY; @@ -380,7 +380,7 @@ static int ll_create(struct inode * dir, struct dentry * dentry, int mode) } if (dentry->d_it->it_disposition) { - struct ll_inode_info *ii = ll_i2info(inode); + ii = ll_i2info(inode); ii->lli_flags |= OBD_FL_CREATEONOPEN; memcpy(&ii->lli_intent_lock_handle, dentry->d_it->it_lock_handle, diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index b863425..75b225d 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -192,7 +192,7 @@ static inline int lov_stripe_md_size(struct obd_device *obd) static int lov_create(struct lustre_handle *conn, struct obdo *oa, struct lov_stripe_md **ea) { - int rc, i; + int rc = 0, i; struct obdo tmp; struct obd_export *export = class_conn2export(conn); struct lov_obd *lov; @@ -253,7 +253,7 @@ static int lov_create(struct lustre_handle *conn, struct obdo *oa, struct lov_st static int lov_destroy(struct lustre_handle *conn, struct obdo *oa, struct lov_stripe_md *ea) { - int rc, i; + int rc = 0, i; struct obdo tmp; struct obd_export *export = class_conn2export(conn); struct lov_obd *lov; diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 5e205ee..c09a6188 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -345,7 +345,7 @@ static int mds_getlovinfo(struct ptlrpc_request *req) rc = mds_get_lovtgts(req->rq_obd, tgt_count, lustre_msg_buf(req->rq_repmsg, 1)); if (rc) { - CERROR("get_lovtgts error %d", rc); + CERROR("get_lovtgts error %d\n", rc); req->rq_status = rc; RETURN(0); } diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 1be342a..54b2006 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -112,7 +112,6 @@ int mds_get_lovtgts(struct obd_device *obd, int tgt_count, uuid_t *uuidarray) struct file *f; int rc; int rc2; - int count; push_ctxt(&saved, &mds->mds_ctxt); f = filp_open("LOVTGTS", O_RDONLY, 0644); @@ -127,12 +126,13 @@ int mds_get_lovtgts(struct obd_device *obd, int tgt_count, uuid_t *uuidarray) if (rc2) CERROR("Error closing LOVTGTS file: rc = %d\n", rc2); - if (rc != count * sizeof(uuid_t)) { + if (rc != tgt_count * sizeof(uuid_t)) { CERROR("Error reading LOVTGTS file: rc = %d\n", rc); if (rc >= 0) rc = -EIO; GOTO(out, rc); - } + } else + rc = 0; EXIT; out: pop_ctxt(&saved); diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index 73251d2..73eb518 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -459,10 +459,10 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp, } case OBD_IOC_DESTROY: { - void *ea; + //void *ea; obd_data2conn(&conn, data); - err = obd_destroy(&conn, &data->ioc_obdo1, ea); + err = obd_destroy(&conn, &data->ioc_obdo1, NULL); if (err) GOTO(out, err); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index f708884..95d0f9b 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -717,7 +717,6 @@ static int filter_pgcache_brw(int cmd, struct lustre_handle *conn, { struct obd_run_ctxt saved; struct super_block *sb; - int onum; /* index to oas */ int pnum; /* index to pages (bufs) */ unsigned long retval; int error; @@ -741,9 +740,9 @@ static int filter_pgcache_brw(int cmd, struct lustre_handle *conn, /* count doubles as retval */ for (pg = 0; pg < oa_bufs; pg++) { - CDEBUG(D_INODE, "OP %d obdo no/pno: (%d,%d) (%ld,%ld) " + CDEBUG(D_INODE, "OP %d obdo pgno: (%d) (%ld,%ld) " "off count (%Ld,%Ld)\n", - cmd, onum, pnum, file->f_dentry->d_inode->i_ino, + cmd, pnum, file->f_dentry->d_inode->i_ino, (unsigned long)offset[pnum] >> PAGE_CACHE_SHIFT, (unsigned long long)offset[pnum], (unsigned long long)count[pnum]); diff --git a/lustre/utils/Makefile.am b/lustre/utils/Makefile.am index 3ec0fbc..96ad15a 100644 --- a/lustre/utils/Makefile.am +++ b/lustre/utils/Makefile.am @@ -1,6 +1,6 @@ DEFS= -CFLAGS:=-g -I. -I/usr/include/libxml2 -I/usr/include/glib-1.2 -I$(PORTALS)/include \ +CFLAGS:=-g -O2 -I. -I/usr/include/libxml2 -I/usr/include/glib-1.2 -I$(PORTALS)/include \ -I/usr/lib/glib/include -I$(srcdir)/../include -Wall KFLAGS:= CPPFLAGS = diff --git a/lustre/utils/device.c b/lustre/utils/device.c index 0061425..d5e61ba 100644 --- a/lustre/utils/device.c +++ b/lustre/utils/device.c @@ -506,7 +506,7 @@ int jt_dev_lov_config(int argc, char **argv) if (strlen(argv[1]) > sizeof(uuid_t) - 1) { fprintf(stderr, "lov_config: no %dB memory for uuid's\n", - size); + strlen(argv[1])); return -ENOMEM; } @@ -666,7 +666,7 @@ int jt_dev_getattr(int argc, char **argv) int jt_dev_test_getattr(int argc, char **argv) { - int rc; + int rc = 0; struct obd_ioctl_data data; struct timeval start, next_time; int i, count, next_count; @@ -721,7 +721,7 @@ int jt_dev_test_getattr(int argc, char **argv) int jt_dev_test_brw(int argc, char **argv) { - int rc; + int rc = 0; struct obd_ioctl_data data; struct timeval start, next_time; char *bulk, *b; diff --git a/lustre/utils/lconf b/lustre/utils/lconf index 9a9a077..86dae59 100755 --- a/lustre/utils/lconf +++ b/lustre/utils/lconf @@ -375,7 +375,7 @@ def prepare_mdc(node): def prepare_mountpoint(node): name, uuid, oscuuid, mdcuuid, mtpt = getMTPTInfo(node) print 'MTPT:', name, uuid, oscuuid, mdcuuid, mtpt - cmd = "mount -t lustre_lite -o ost=%s,mds=%s none %s" % \ + cmd = "echo mount -t lustre_lite -o ost=%s,mds=%s none %s" % \ (oscuuid, mdcuuid, mtpt) run("mkdir", mtpt) run(cmd) diff --git a/lustre/utils/lctl.c b/lustre/utils/lctl.c index 1f8772d..5b59cce 100644 --- a/lustre/utils/lctl.c +++ b/lustre/utils/lctl.c @@ -270,7 +270,7 @@ int jt_opt_threads(int argc, char **argv) int threads, next_thread; int verbose; int i, j; - int rc; + int rc = 0; if (argc < 5) { fprintf(stderr, diff --git a/lustre/utils/obdctl.c b/lustre/utils/obdctl.c index 143f88e..f347c79 100644 --- a/lustre/utils/obdctl.c +++ b/lustre/utils/obdctl.c @@ -1437,7 +1437,7 @@ static int jt_lov_config(int argc, char **argv) if (strlen(argv[1]) > sizeof(uuid_t) - 1) { fprintf(stderr, "lov_config: no %dB memory for uuid's\n", - size); + strlen(argv[1])); return -ENOMEM; } -- 1.8.3.1