Whamcloud - gitweb
merge b_llpmd into b_devel. the major highlights:
authorphil <phil>
Tue, 9 Sep 2003 03:54:14 +0000 (03:54 +0000)
committerphil <phil>
Tue, 9 Sep 2003 03:54:14 +0000 (03:54 +0000)
- new I/O backend
- new client page cache and llite/lov/osc plumbing
- pre-creation of OST objects
- most of the OBD protocol now revolves around exports, not obd_devices

lustre/cobd/cache_obd.c
lustre/cobd/lproc_cache.c
lustre/kernel_patches/patches/lustre_version.patch
lustre/obdclass/fsfilt_ext3.c

index 2d3549b..9492509 100644 (file)
@@ -54,6 +54,7 @@ cobd_setup (struct obd_device *dev, obd_count len, void *buf)
         struct obd_device *cache;
         struct obd_uuid target_uuid;
         struct obd_uuid cache_uuid;
+        struct lustre_handle target_conn = {0,}, cache_conn = {0,};
         int                rc;
 
         if (data->ioc_inlbuf1 == NULL ||
@@ -71,19 +72,19 @@ cobd_setup (struct obd_device *dev, obd_count len, void *buf)
 
         /* don't bother checking attached/setup;
          * obd_connect() should, and it can change underneath us */
-        rc = obd_connect (&cobd->cobd_target, target, &target_uuid);
+        rc = obd_connect(&target_conn, target, &target_uuid);
         if (rc != 0)
                 return (rc);
+        cobd->cobd_target_exp = class_conn2export(&target_conn);
 
-        rc = obd_connect (&cobd->cobd_cache, cache, &cache_uuid);
-        if (rc != 0)
-                goto fail_0;
-
-        return (0);
+        rc = obd_connect(&cache_conn, cache, &cache_uuid);
+        if (rc != 0) {
+                obd_disconnect(cobd->cobd_target_exp, 0);
+                return rc;
+        }
+        cobd->cobd_cache_exp = class_conn2export(&cache_conn);
 
- fail_0:
-        obd_disconnect(&cobd->cobd_target, 0);
-        return (rc);
+        return rc;
 }
 
 static int cobd_cleanup(struct obd_device *dev, int flags)
@@ -94,11 +95,11 @@ static int cobd_cleanup(struct obd_device *dev, int flags)
         if (!list_empty(&dev->obd_exports))
                 return (-EBUSY);
 
-        rc = obd_disconnect(&cobd->cobd_cache, flags);
+        rc = obd_disconnect(cobd->cobd_cache_exp, flags);
         if (rc != 0)
                 CERROR ("error %d disconnecting cache\n", rc);
 
-        rc = obd_disconnect(&cobd->cobd_target, flags);
+        rc = obd_disconnect(cobd->cobd_target_exp, flags);
         if (rc != 0)
                 CERROR ("error %d disconnecting target\n", rc);
 
@@ -115,23 +116,23 @@ cobd_connect (struct lustre_handle *conn, struct obd_device *obd,
         return (rc);
 }
 
-static int cobd_disconnect(struct lustre_handle *conn, int flags)
+static int cobd_disconnect(struct obd_export *exp, int flags)
 {
-        int rc = class_disconnect(conn, flags);
+        int rc = class_disconnect(exp, flags);
 
         CERROR ("rc %d\n", rc);
         return (rc);
 }
 
-static int
-cobd_get_info(struct lustre_handle *conn, obd_count keylen,
-              void *key, __u32 *vallen, void *val)
+static int cobd_get_info(struct obd_export *exp, obd_count keylen,
+                         void *key, __u32 *vallen, void *val)
 {
-        struct obd_device *obd = class_conn2obd(conn);
+        struct obd_device *obd = class_exp2obd(exp);
         struct cache_obd  *cobd;
 
         if (obd == NULL) {
-                CERROR("invalid client cookie "LPX64"\n", conn->cookie);
+                CERROR("invalid client cookie "LPX64"\n", 
+                       exp->exp_handle.h_cookie);
                 return -EINVAL;
         }
 
@@ -139,62 +140,30 @@ cobd_get_info(struct lustre_handle *conn, obd_count keylen,
 
         /* intercept cache utilisation info? */
 
-        return obd_get_info(&cobd->cobd_target, keylen, key, vallen, val);
+        return obd_get_info(cobd->cobd_target_exp, keylen, key, vallen, val);
 }
 
 static int cobd_statfs(struct obd_device *obd, struct obd_statfs *osfs,
                        unsigned long max_age)
 {
-        return obd_statfs(class_conn2obd(&obd->u.cobd.cobd_target), osfs,
+        return obd_statfs(class_exp2obd(obd->u.cobd.cobd_target_exp), osfs,
                           max_age);
 }
 
-static int cobd_getattr(struct lustre_handle *conn, struct obdo *oa,
+static int cobd_getattr(struct obd_export *exp, struct obdo *oa,
                         struct lov_stripe_md *lsm)
 {
-        struct obd_device *obd = class_conn2obd(conn);
-        struct cache_obd  *cobd;
-
-        if (obd == NULL) {
-                CERROR("invalid client cookie "LPX64"\n", conn->cookie);
-                return -EINVAL;
-        }
-
-        cobd = &obd->u.cobd;
-        return (obd_getattr (&cobd->cobd_target, oa, lsm));
-}
-
-static int
-cobd_open(struct lustre_handle *conn, struct obdo *oa,
-          struct lov_stripe_md *lsm, struct obd_trans_info *oti,
-          struct obd_client_handle *och)
-{
-        struct obd_device *obd = class_conn2obd(conn);
-        struct cache_obd  *cobd;
-
-        if (obd == NULL) {
-                CERROR("invalid client cookie "LPX64"\n", conn->cookie);
-                return -EINVAL;
-        }
-
-        cobd = &obd->u.cobd;
-        return (obd_open (&cobd->cobd_target, oa, lsm, oti, och));
-}
-
-static int
-cobd_close(struct lustre_handle *conn, struct obdo *oa,
-           struct lov_stripe_md *lsm, struct obd_trans_info *oti)
-{
-        struct obd_device *obd = class_conn2obd(conn);
+        struct obd_device *obd = class_exp2obd(exp);
         struct cache_obd  *cobd;
 
         if (obd == NULL) {
-                CERROR("invalid client cookie "LPX64"\n", conn->cookie);
+                CERROR("invalid client cookie "LPX64"\n", 
+                        exp->exp_handle.h_cookie);
                 return -EINVAL;
         }
 
         cobd = &obd->u.cobd;
-        return (obd_close (&cobd->cobd_target, oa, lsm, oti));
+        return obd_getattr(cobd->cobd_target_exp, oa, lsm);
 }
 
 static int cobd_preprw(int cmd, struct obd_export *exp, struct obdo *oa,
@@ -211,10 +180,9 @@ static int cobd_preprw(int cmd, struct obd_export *exp, struct obdo *oa,
         if ((cmd & OBD_BRW_WRITE) != 0)
                 return -EOPNOTSUPP;
 
-        cobd_exp = class_conn2export(&exp->exp_obd->u.cobd.cobd_target);
+        cobd_exp = exp->exp_obd->u.cobd.cobd_target_exp;
         rc = obd_preprw(cmd, cobd_exp, oa, objcount, obj, niocount, nb, res,
                         oti);
-        class_export_put(cobd_exp);
 
         return rc;
 }
@@ -233,21 +201,21 @@ static int cobd_commitrw(int cmd, struct obd_export *exp, struct obdo *oa,
         if ((cmd & OBD_BRW_WRITE) != 0)
                 return -EOPNOTSUPP;
 
-        cobd_exp = class_conn2export(&exp->exp_obd->u.cobd.cobd_target);
+        cobd_exp = exp->exp_obd->u.cobd.cobd_target_exp;
         rc = obd_commitrw(cmd, cobd_exp, oa, objcount, obj,niocount,local,oti);
-        class_export_put(cobd_exp);
         return rc;
 }
 
-static int cobd_brw(int cmd, struct lustre_handle *conn, struct obdo *oa,
+static int cobd_brw(int cmd, struct obd_export *exp, struct obdo *oa,
                     struct lov_stripe_md *lsm, obd_count oa_bufs,
                     struct brw_page *pga, struct obd_trans_info *oti)
 {
-        struct obd_device *obd = class_conn2obd(conn);
+        struct obd_device *obd = class_exp2obd(exp);
         struct cache_obd  *cobd;
 
         if (obd == NULL) {
-                CERROR("invalid client cookie "LPX64"\n", conn->cookie);
+                CERROR("invalid client cookie "LPX64"\n", 
+                       exp->exp_handle.h_cookie);
                 return -EINVAL;
         }
 
@@ -255,24 +223,25 @@ static int cobd_brw(int cmd, struct lustre_handle *conn, struct obdo *oa,
                 return -EOPNOTSUPP;
 
         cobd = &obd->u.cobd;
-        return (obd_brw(cmd, &cobd->cobd_target, oa, lsm, oa_bufs, pga, oti));
+        return obd_brw(cmd, cobd->cobd_target_exp, oa, lsm, oa_bufs, pga, oti);
 }
 
-static int cobd_iocontrol(unsigned int cmd, struct lustre_handle *conn, int len,
+static int cobd_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                           void *karg, void *uarg)
 {
-        struct obd_device *obd = class_conn2obd(conn);
+        struct obd_device *obd = class_exp2obd(exp);
         struct cache_obd  *cobd;
 
         if (obd == NULL) {
-                CERROR("invalid client cookie "LPX64"\n", conn->cookie);
+                CERROR("invalid client cookie "LPX64"\n", 
+                       exp->exp_handle.h_cookie);
                 return -EINVAL;
         }
 
         /* intercept? */
 
         cobd = &obd->u.cobd;
-        return (obd_iocontrol(cmd, &cobd->cobd_target, len, karg, uarg));
+        return obd_iocontrol(cmd, cobd->cobd_target_exp, len, karg, uarg);
 }
 
 static struct obd_ops cobd_ops = {
@@ -290,8 +259,6 @@ static struct obd_ops cobd_ops = {
         o_statfs:               cobd_statfs,
 
         o_getattr:              cobd_getattr,
-        o_open:                 cobd_open,
-        o_close:                cobd_close,
         o_preprw:               cobd_preprw,
         o_commitrw:             cobd_commitrw,
         o_brw:                  cobd_brw,
index ba9b9cf..bbe3231 100644 (file)
@@ -41,7 +41,7 @@ static int cobd_rd_target(char *page, char **start, off_t off, int count,
                 rc = snprintf(page, count, "not set up\n");
         } else {
                 struct obd_device *tgt =
-                        class_conn2obd(&cobd->u.cobd.cobd_target);
+                        class_exp2obd(cobd->u.cobd.cobd_target_exp);
                 LASSERT(tgt != NULL);
                 rc = snprintf(page, count, "%s\n", tgt->obd_uuid.uuid);
         }
@@ -60,7 +60,7 @@ static int cobd_rd_cache(char *page, char **start, off_t off, int count,
                 rc = snprintf(page, count, "not set up\n");
         } else {
                 struct obd_device *cache =
-                        class_conn2obd(&cobd->u.cobd.cobd_cache);
+                        class_exp2obd(cobd->u.cobd.cobd_cache_exp);
                 LASSERT(cache != NULL);
                 rc = snprintf(page, count, "%s\n", cache->obd_uuid.uuid);
         }
index c4effbc..fa582c6 100644 (file)
@@ -7,6 +7,6 @@
 --- /dev/null  Fri Aug 30 17:31:37 2002
 +++ linux-2.4.18-18.8.0-l12-braam/include/linux/lustre_version.h       Thu Feb 13 07:58:33 2003
 @@ -0,0 +1 @@
-+#define LUSTRE_KERNEL_VERSION 24
++#define LUSTRE_KERNEL_VERSION 25
 
 _
index 84c9fc3..830bf68 100644 (file)
@@ -648,6 +648,10 @@ static struct fsfilt_operations fsfilt_ext3_ops = {
         fs_read_record:         fsfilt_ext3_read_record,
 };
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
+
+#warning "fsfilt_ext3_init() and fsfilt_ext3_exit() aren't called on 2.6. MUST be fixed"
+
 static int __init fsfilt_ext3_init(void)
 {
         int rc;
@@ -690,3 +694,6 @@ MODULE_LICENSE("GPL");
 
 module_init(fsfilt_ext3_init);
 module_exit(fsfilt_ext3_exit);
+
+#endif
+