Whamcloud - gitweb
- Added DEBUG_SUBSYSTEMs
[fs/lustre-release.git] / lustre / obdclass / genops.c
index 445b410..9db8901 100644 (file)
@@ -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 <linux/mm.h>
+#include <linux/pagemap.h>
 #include <linux/fs.h>
 #include <linux/sched.h>
 #include <asm/uaccess.h>
 
+#define DEBUG_SUBSYSTEM S_CLASS
+
 #include <linux/obd_support.h>
 #include <linux/obd_class.h>
 
-
 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 */