X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdclass%2Fgenops.c;h=9db8901bcf0a3142235c3ea932858fa4e4ae450b;hb=00102f342959b094f035b618c0b7acf477de35b4;hp=445b410ceb92e9144ff82eba6138bed396da9fa8;hpb=667e9cd3c1193c9e858512ced5ebccd26e0e6ab2;p=fs%2Flustre-release.git diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 445b410..9db8901 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -1,21 +1,26 @@ /* * linux/fs/ext2_obd/sim_obd.c + * Copyright (C) 2001 Cluster File Systems, Inc. + * + * This code is issued under the GNU General Public License. + * See the file COPYING in this distribution * * These are the only exported functions; they provide the simulated object- * oriented disk. * */ - #include +#include #include #include #include +#define DEBUG_SUBSYSTEM S_CLASS + #include #include - extern struct obd_device obd_dev[MAX_OBD_DEVICES]; kmem_cache_t *obdo_cachep = NULL; @@ -59,7 +64,7 @@ void obd_cleanup_obdo_cache(void) /* map connection to client */ -struct obd_client *gen_client(struct obd_conn *conn) +struct obd_client *gen_client(const struct obd_conn *conn) { struct obd_device * obddev = conn->oc_dev; struct list_head * lh, * next; @@ -82,7 +87,7 @@ int gen_connect (struct obd_conn *conn) { struct obd_client * cli; - OBD_ALLOC(cli, struct obd_client *, sizeof(struct obd_client)); + OBD_ALLOC(cli, sizeof(struct obd_client)); if ( !cli ) { printk(__FUNCTION__ ": no memory! (minor %d)\n", conn->oc_dev->obd_minor); @@ -266,16 +271,14 @@ int gen_copy_data(struct obd_conn *dst_conn, struct obdo *dst, while (index < ((src->o_size + PAGE_SIZE - 1) >> PAGE_SHIFT)) { obd_count num_oa = 1; obd_count num_buf = 1; - char *buf; obd_size brw_count = PAGE_SIZE; obd_off brw_offset = (page->index) << PAGE_SHIFT; obd_flag flagr = 0; obd_flag flagw = OBD_BRW_CREATE; page->index = index; - buf = (char *)page_address(page); err = OBP(src_conn->oc_dev, brw)(READ, src_conn, num_oa, &src, - &num_buf, &buf, &brw_count, + &num_buf, &page, &brw_count, &brw_offset, &flagr); if ( err ) { @@ -285,7 +288,7 @@ int gen_copy_data(struct obd_conn *dst_conn, struct obdo *dst, CDEBUG(D_INFO, "Read page %ld ...\n", page->index); err = OBP(dst_conn->oc_dev, brw)(WRITE, dst_conn, num_oa, &dst, - &num_buf, &buf, &brw_count, + &num_buf, &page, &brw_count, &brw_offset, &flagw); /* XXX should handle dst->o_size, dst->o_blocks here */