Whamcloud - gitweb
b=15260
[fs/lustre-release.git] / lustre / obdecho / echo_client.c
index f0c6fb4..9d2e968 100644 (file)
@@ -1,25 +1,37 @@
 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
  * vim:expandtab:shiftwidth=8:tabstop=8:
  *
- *  Copyright (c) 2001-2003 Cluster File Systems, Inc.
+ * GPL HEADER START
  *
- *   This file is part of the Lustre file system, http://www.lustre.org
- *   Lustre is a trademark of Cluster File Systems, Inc.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *   You may have signed or agreed to another license before downloading
- *   this software.  If so, you are bound by the terms and conditions
- *   of that agreement, and the following does not apply to you.  See the
- *   LICENSE file included with this distribution for more information.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
  *
- *   If you did not agree to a different license, then this copy of Lustre
- *   is open source software; you can redistribute it and/or modify it
- *   under the terms of version 2 of the GNU General Public License as
- *   published by the Free Software Foundation.
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
  *
- *   In either case, Lustre is distributed in the hope that it will be
- *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- *   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   license text for more details.
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Use is subject to license terms.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_ECHO
@@ -45,16 +57,16 @@ echo_printk_object (char *msg, struct ec_object *eco)
         struct lov_stripe_md *lsm = eco->eco_lsm;
         int                   i;
 
-        printk (KERN_INFO "Lustre: %s: object %p: "LPX64", refs %d%s: "LPX64
+        CDEBUG(D_INFO, "Lustre: %s: object %p: "LPX64", refs %d%s: "LPX64
                 "=%u!%u\n", msg, eco, eco->eco_id, eco->eco_refcount,
                 eco->eco_deleted ? "(deleted) " : "",
                 lsm->lsm_object_id, lsm->lsm_stripe_size,
                 lsm->lsm_stripe_count);
 
         for (i = 0; i < lsm->lsm_stripe_count; i++)
-                printk (KERN_INFO "Lustre:   @%2u:"LPX64"\n",
-                        lsm->lsm_oinfo[i].loi_ost_idx,
-                        lsm->lsm_oinfo[i].loi_id);
+                CDEBUG(D_INFO, "Lustre:   @%2u:"LPX64"\n",
+                       lsm->lsm_oinfo[i].loi_ost_idx,
+                       lsm->lsm_oinfo[i].loi_id);
 }
 #endif
 
@@ -581,18 +593,6 @@ static int echo_client_kbrw(struct obd_device *obd, int rw, struct obdo *oa,
         return (rc);
 }
 
-#ifdef __KERNEL__
-static int echo_client_ubrw(struct obd_device *obd, int rw,
-                            struct obdo *oa, struct lov_stripe_md *lsm,
-                            obd_off offset, obd_size count, char *buffer,
-                            struct obd_trans_info *oti)
-{
-#warning "echo_client_ubrw() needs to be ported on 2.6 yet"
-        LBUG();
-        return 0;
-}
-#endif
-
 struct echo_async_state;
 
 #define EAP_MAGIC 79277927
@@ -785,7 +785,7 @@ static int echo_client_async_page(struct obd_export *exp, int rw,
 
                 rc = obd_prep_async_page(exp, lsm, NULL, eap->eap_page,
                                          eap->eap_off, &ec_async_page_ops,
-                                         eap, &eap->eap_cookie);
+                                         eap, &eap->eap_cookie, 1, NULL);
                 if (rc) {
                         spin_lock(&eas.eas_lock);
                         eas.eas_rc = rc;
@@ -948,18 +948,9 @@ int echo_client_brw_ioctl(int rw, struct obd_export *exp,
 
         switch((long)data->ioc_pbuf1) {
         case 1:
-                if (data->ioc_pbuf2 == NULL) { // NULL user data pointer
-                        rc = echo_client_kbrw(obd, rw, &data->ioc_obdo1,
+                rc = echo_client_kbrw(obd, rw, &data->ioc_obdo1,
                                               eco->eco_lsm, data->ioc_offset,
                                               data->ioc_count, &dummy_oti);
-                } else {
-#ifdef __KERNEL__
-                        rc = echo_client_ubrw(obd, rw, &data->ioc_obdo1,
-                                              eco->eco_lsm, data->ioc_offset,
-                                              data->ioc_count, data->ioc_pbuf2,
-                                              &dummy_oti);
-#endif
-                }
                 break;
         case 2:
                 rc = echo_client_async_page(ec->ec_exp, rw, &data->ioc_obdo1,
@@ -1030,7 +1021,7 @@ echo_client_enqueue(struct obd_export *exp, struct obdo *oa,
 {
         struct obd_device      *obd = exp->exp_obd;
         struct echo_client_obd *ec = &obd->u.echo_client;
-        struct lustre_handle   *ulh = obdo_handle (oa);
+        struct lustre_handle   *ulh = &oa->o_handle;
         struct ldlm_enqueue_info einfo = { 0 };
         struct obd_info oinfo = { { { 0 } } };
         struct ec_object       *eco;
@@ -1098,7 +1089,7 @@ echo_client_cancel(struct obd_export *exp, struct obdo *oa)
 {
         struct obd_device      *obd = exp->exp_obd;
         struct echo_client_obd *ec = &obd->u.echo_client;
-        struct lustre_handle   *ulh = obdo_handle (oa);
+        struct lustre_handle   *ulh = &oa->o_handle;
         struct ec_lock         *ecl = NULL;
         int                     found = 0;
         struct list_head       *el;