Whamcloud - gitweb
b=6427
[fs/lustre-release.git] / lustre / cobd / cache_obd.c
index dd446bd..9025798 100644 (file)
@@ -55,43 +55,45 @@ static int cobd_setup(struct obd_device *obd, obd_count len, void *buf)
         int rc = 0;
         ENTRY;
 
-        if (lcfg->lcfg_inllen1 == 0 || lcfg->lcfg_inlbuf1 == NULL) {
+        if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1 ||
+            lustre_cfg_buf(lcfg, 1) == NULL) {
                 CERROR("%s: setup requires master device name\n", 
                        obd->obd_name);
                 RETURN(-EINVAL);
         }
 
-        if (lcfg->lcfg_inllen2 == 0 || lcfg->lcfg_inlbuf2 == NULL) {
+        if (LUSTRE_CFG_BUFLEN(lcfg, 2) < 1 ||
+            lustre_cfg_buf(lcfg, 2) == NULL) {
                 CERROR("%s: setup requires cache device name\n",
                        obd->obd_name);
                 RETURN(-EINVAL);
         }
 
-        master = class_name2obd(lcfg->lcfg_inlbuf1);
+        master = class_name2obd(lustre_cfg_string(lcfg, 1));
         if (!master) {
                 CERROR("%s: unable to find master: %s\n",
-                       obd->obd_name, lcfg->lcfg_inlbuf1);
+                       obd->obd_name, lustre_cfg_string(lcfg, 1));
                 RETURN(-EINVAL);
         }
 
         sema_init(&cobd->sem, 1);
 
-        OBD_ALLOC(cobd->master_name, lcfg->lcfg_inllen1);
+        OBD_ALLOC(cobd->master_name, LUSTRE_CFG_BUFLEN(lcfg, 1));
         if (!cobd->master_name) 
                 RETURN(-ENOMEM);
-        memcpy(cobd->master_name, lcfg->lcfg_inlbuf1
-               lcfg->lcfg_inllen1);
+        memcpy(cobd->master_name, lustre_cfg_string(lcfg, 1)
+               LUSTRE_CFG_BUFLEN(lcfg, 1));
         
-        OBD_ALLOC(cobd->cache_name, lcfg->lcfg_inllen2);
+        OBD_ALLOC(cobd->cache_name, LUSTRE_CFG_BUFLEN(lcfg, 2));
         if (!cobd->cache_name) 
                 GOTO(put_names, rc = -ENOMEM);
-        memcpy(cobd->cache_name, lcfg->lcfg_inlbuf2
-               lcfg->lcfg_inllen2);
+        memcpy(cobd->cache_name, lustre_cfg_string(lcfg, 2)
+               LUSTRE_CFG_BUFLEN(lcfg, 2));
 
         EXIT;
 put_names:
         if (rc) {
-                OBD_FREE(cobd->master_name, lcfg->lcfg_inllen1);
+                OBD_FREE(cobd->master_name, LUSTRE_CFG_BUFLEN(lcfg, 1));
                 cobd->master_name = NULL;
         }
         return rc;
@@ -126,6 +128,7 @@ cobd_get_exp(struct obd_device *obd)
 
 static int client_obd_connect(struct obd_device *obd, char *name,
                               struct lustre_handle *conn,
+                              struct obd_connect_data *data,
                               unsigned long flags)
 { 
         struct obd_device *cli_obd;
@@ -142,7 +145,7 @@ static int client_obd_connect(struct obd_device *obd, char *name,
                        obd->obd_name, name);
                 RETURN(-EINVAL);
         }
-        rc = obd_connect(conn, cli_obd, &obd->obd_uuid, flags);
+        rc = obd_connect(conn, cli_obd, &obd->obd_uuid, data, flags);
         if (rc) {
                 CERROR("error connecting to %s, err %d\n",
                        name, rc);
@@ -172,7 +175,8 @@ static int client_obd_disconnect(struct obd_device *obd,
 
 static int
 cobd_connect(struct lustre_handle *conn, struct obd_device *obd,
-             struct obd_uuid *cluuid, unsigned long flags)
+             struct obd_uuid *cluuid, struct obd_connect_data *data,
+             unsigned long flags)
 {
         struct lustre_handle cache_conn = { 0 };
         struct cache_obd *cobd = &obd->u.cobd;
@@ -188,7 +192,7 @@ cobd_connect(struct lustre_handle *conn, struct obd_device *obd,
 
         /* connecting cache */
         rc = client_obd_connect(obd, cobd->cache_name,
-                                &cache_conn, flags);
+                                &cache_conn, data, flags);
         if (rc)
                 GOTO(err_discon, rc);
         cobd->cache_exp = class_conn2export(&cache_conn);
@@ -235,7 +239,7 @@ cobd_disconnect(struct obd_export *exp, unsigned long flags)
         RETURN(rc);
 }
 
-static int cobd_get_info(struct obd_export *exp, obd_count keylen,
+static int cobd_get_info(struct obd_export *exp, __u32 keylen,
                          void *key, __u32 *vallen, void *val)
 {
         struct obd_device *obd = class_exp2obd(exp);
@@ -313,6 +317,7 @@ static int cobd_unpackmd(struct obd_export *exp,
 }
 
 static int cobd_create(struct obd_export *exp, struct obdo *obdo,
+                       void *acl, int acl_size,
                        struct lov_stripe_md **ea,
                        struct obd_trans_info *oti)
 {
@@ -325,7 +330,7 @@ static int cobd_create(struct obd_export *exp, struct obdo *obdo,
                 return -EINVAL;
         }
         cobd_exp = cobd_get_exp(obd);
-        return obd_create(cobd_exp, obdo, ea, oti); 
+        return obd_create(cobd_exp, obdo, acl, acl_size, ea, oti);
 }
 
 static int cobd_destroy(struct obd_export *exp, struct obdo *obdo,
@@ -351,7 +356,7 @@ static int cobd_precleanup(struct obd_device *obd, int flags)
 }
 
 static int cobd_getattr(struct obd_export *exp, struct obdo *oa,
-                        struct lov_stripe_md *lsm)
+                        struct lov_stripe_md *ea)
 {
         struct obd_device *obd = class_exp2obd(exp);
         struct obd_export *cobd_exp;
@@ -362,7 +367,7 @@ static int cobd_getattr(struct obd_export *exp, struct obdo *oa,
                 return -EINVAL;
         }
         cobd_exp = cobd_get_exp(obd);
-        return obd_getattr(cobd_exp, oa, lsm);
+        return obd_getattr(cobd_exp, oa, ea);
 }
 
 static int cobd_getattr_async(struct obd_export *exp,
@@ -731,7 +736,8 @@ static int cobd_iocontrol(unsigned int cmd, struct obd_export *exp,
                         struct lustre_handle conn = {0};
 
                         rc = client_obd_disconnect(obd, cobd->master_exp, 0);
-                        rc = client_obd_connect(obd, cobd->cache_name, &conn, 0);
+                        rc = client_obd_connect(obd, cobd->cache_name, &conn,
+                                                NULL, 0);
                         if (rc)
                                 GOTO(out, rc);
                         cobd->cache_exp = class_conn2export(&conn);
@@ -750,7 +756,8 @@ static int cobd_iocontrol(unsigned int cmd, struct obd_export *exp,
                         cooksize = cache->u.cli.cl_max_mds_cookiesize;
                         
                         rc = client_obd_disconnect(obd, cobd->cache_exp, 0);
-                        rc = client_obd_connect(obd, cobd->master_name, &conn, 0);
+                        rc = client_obd_connect(obd, cobd->master_name, &conn,
+                                                NULL, 0);
                         if (rc)
                                 GOTO(out, rc);
                         cobd->master_exp = class_conn2export(&conn);
@@ -870,8 +877,8 @@ static int  cobd_import_event(struct obd_device *obd,
 }
 
 static int cobd_md_getattr(struct obd_export *exp, struct lustre_id *id,
-                           __u64 valid, unsigned int ea_size,
-                           struct ptlrpc_request **request)
+                          __u64 valid, const char *ea_name, int ea_namelen,
+                           unsigned int ea_size, struct ptlrpc_request **request)
 {
         struct obd_device *obd = class_exp2obd(exp);
         struct obd_export *cobd_exp;
@@ -882,7 +889,7 @@ static int cobd_md_getattr(struct obd_export *exp, struct lustre_id *id,
                 return -EINVAL;
         }
         cobd_exp = cobd_get_exp(obd);
-        return md_getattr(cobd_exp, id, valid, ea_size, request);
+        return md_getattr(cobd_exp, id, valid, NULL, 0, ea_size, request);
 }
 
 static int cobd_md_req2lustre_md (struct obd_export *mdc_exp,