From 557e7ff6df1b53fba20d7ac39f1f41cffb369d49 Mon Sep 17 00:00:00 2001 From: adilger Date: Sat, 4 Dec 1999 00:10:03 +0000 Subject: [PATCH] Makefile: made "all" the default target class/class_obd.c, class/genops.c, snap/snap.c: re-ordered migrate, copy argument order to be consistent (dst, src) snap/snap.c: fixed unlink to work in all cases of (direct, indirect) snap/setup.sh: check for mounted obdfs before starting snap/cleanup.sh: remove loop device ext2obd/ext2_obd.c: start of iterator function --- lustre/include/linux/obd_class.h | 2 +- lustre/obdclass/class_obd.c | 2 +- lustre/obdclass/genops.c | 14 +++++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index 4f16f4f..640f691 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -238,7 +238,7 @@ static __inline__ obdattr *obd_oa_fromid(struct obd_conn *conn, objid id) OBD_ALLOC(res, obdattr *, sizeof(*res)); if ( !res ) return NULL; - + memset(res, 0, sizeof(*res)); res->i_ino = id; if (conn->oc_dev->obd_type->typ_ops->o_getattr(conn, res)) { OBD_FREE(res, sizeof(*res)); diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index ceb72c3..aab4274 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -409,7 +409,7 @@ static int obd_class_ioctl (struct inode * inode, struct file * filp, conn.oc_id = mvdata.conn_id; - err = obddev->obd_type->typ_ops->o_migrate(&conn, srcoa, tgtoa); + err = obddev->obd_type->typ_ops->o_migrate(&conn, tgtoa, srcoa); obd_free_oa(srcoa); obd_free_oa(tgtoa); diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 929dc88..5196a9b 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -199,16 +199,21 @@ void lck_page(struct page *page) ___wait_on_page(page); } -int gen_copy_data(struct obd_conn *conn, obdattr *src, obdattr *tgt) +/* XXX this should return errors correctly, so should migrate!!! */ +int gen_copy_data(struct obd_conn *conn, obdattr *tgt, obdattr *src) { struct page *page; unsigned long index = 0; int rc; + ENTRY; + CDEBUG(D_INODE, "src: blocks %ld, size %Ld\n", + src->i_blocks, src->i_size); page = alloc_page(GFP_USER); - if ( !page ) + if ( !page ) { + EXIT; return -ENOMEM; - + } lck_page(page); @@ -223,6 +228,8 @@ int gen_copy_data(struct obd_conn *conn, obdattr *src, obdattr *tgt) rc = OBP(conn->oc_dev,brw)(WRITE, conn, tgt, page, 1); if ( rc != PAGE_SIZE) break; + + CDEBUG(D_INODE, "Copied 1 page ...\n"); index ++; } @@ -231,5 +238,6 @@ int gen_copy_data(struct obd_conn *conn, obdattr *src, obdattr *tgt) UnlockPage(page); __free_page(page); + EXIT; return 0; } -- 1.8.3.1