Whamcloud - gitweb
LU-2154 osp: osd-zfs: remove 2.3.x debugging code
authorAndreas Dilger <andreas.dilger@intel.com>
Tue, 30 Apr 2013 22:23:03 +0000 (16:23 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 2 May 2013 05:24:41 +0000 (01:24 -0400)
When LUSTRE_VERSION_CODE is increased beyond 2.3.90 the version
based debug code generates a compile warning and fails to build.
Originally added in commit 04e1d0cb95e1ad12 and 2acb75c36511aca9.

Since we have been running with these checks for months without
problem, and it will soon be inactivated anyway, we may as well
remove the code entirely instead of just fixing it.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I1c104ef388f112c619d4ff4b7f00d17383500c1e
Reviewed-on: http://review.whamcloud.com/6219
Tested-by: Hudson
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-zfs/osd_index.c
lustre/osp/osp_precreate.c

index 2c02470..864b925 100644 (file)
@@ -556,27 +556,21 @@ static int osd_dir_insert(const struct lu_env *env, struct dt_object *dt,
                if (IS_ERR(child))
                        RETURN(PTR_ERR(child));
 
                if (IS_ERR(child))
                        RETURN(PTR_ERR(child));
 
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 3, 91, 0)
-#define OSD_ZFS_INSERT_DOTS_FOR_TESTING__
-#endif
                LASSERT(child->oo_db);
                if (name[0] == '.') {
                        if (name[1] == 0) {
                                /* do not store ".", instead generate it
                                 * during iteration */
                LASSERT(child->oo_db);
                if (name[0] == '.') {
                        if (name[1] == 0) {
                                /* do not store ".", instead generate it
                                 * during iteration */
-#ifndef OSD_ZFS_INSERT_DOTS_FOR_TESTING
                                GOTO(out, rc = 0);
                                GOTO(out, rc = 0);
-#endif
                        } else if (name[1] == '.' && name[2] == 0) {
                                /* update parent dnode in the child.
                                 * later it will be used to generate ".." */
                                udmu_objset_t *uos = &osd->od_objset;
                        } else if (name[1] == '.' && name[2] == 0) {
                                /* update parent dnode in the child.
                                 * later it will be used to generate ".." */
                                udmu_objset_t *uos = &osd->od_objset;
-                               rc = osd_object_sa_update(parent, SA_ZPL_PARENT(uos),
-                                                         &child->oo_db->db_object,
-                                                         8, oh);
-#ifndef OSD_ZFS_INSERT_DOTS_FOR_TESTING
+                               rc = osd_object_sa_update(parent,
+                                                SA_ZPL_PARENT(uos),
+                                                &child->oo_db->db_object,
+                                                8, oh);
                                GOTO(out, rc);
                                GOTO(out, rc);
-#endif
                        }
                }
                CLASSERT(sizeof(oti->oti_zde.lzd_reg) == 8);
                        }
                }
                CLASSERT(sizeof(oti->oti_zde.lzd_reg) == 8);
@@ -592,9 +586,7 @@ static int osd_dir_insert(const struct lu_env *env, struct dt_object *dt,
                      (char *)key, 8, sizeof(oti->oti_zde) / 8,
                      (void *)&oti->oti_zde, oh->ot_tx);
 
                      (char *)key, 8, sizeof(oti->oti_zde) / 8,
                      (void *)&oti->oti_zde, oh->ot_tx);
 
-#ifndef OSD_ZFS_INSERT_DOTS_FOR_TESTING
 out:
 out:
-#endif
        if (child != NULL)
                osd_object_put(env, child);
 
        if (child != NULL)
                osd_object_put(env, child);
 
@@ -642,10 +634,9 @@ static int osd_dir_delete(const struct lu_env *env, struct dt_object *dt,
        LASSERT(th != NULL);
        oh = container_of0(th, struct osd_thandle, ot_super);
 
        LASSERT(th != NULL);
        oh = container_of0(th, struct osd_thandle, ot_super);
 
-#ifndef OSD_ZFS_INSERT_DOTS_FOR_TESTING
        /*
        /*
-        * in Orion . and .. were stored in the directory (not generated up on
-        * request as now. we preserve them for backward compatibility
+        * In Orion . and .. were stored in the directory (not generated upon
+        * request as now). we preserve them for backward compatibility
         */
        if (name[0] == '.') {
                if (name[1] == 0) {
         */
        if (name[0] == '.') {
                if (name[1] == 0) {
@@ -654,7 +645,6 @@ static int osd_dir_delete(const struct lu_env *env, struct dt_object *dt,
                        RETURN(0);
                }
        }
                        RETURN(0);
                }
        }
-#endif
 
        /* Remove key from the ZAP */
        rc = -zap_remove(osd->od_objset.os, zap_db->db_object,
 
        /* Remove key from the ZAP */
        rc = -zap_remove(osd->od_objset.os, zap_db->db_object,
@@ -841,7 +831,7 @@ static struct dt_key *osd_dir_it_key(const struct lu_env *env,
 
        strcpy(it->ozi_name, za->za_name);
 
 
        strcpy(it->ozi_name, za->za_name);
 
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 3, 91, 0)
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 3, 90, 0)
        if (za->za_name[0] == '.') {
                if (za->za_name[1] == 0 || (za->za_name[1] == '.' &&
                    za->za_name[2] == 0)) {
        if (za->za_name[0] == '.') {
                if (za->za_name[1] == 0 || (za->za_name[1] == '.' &&
                    za->za_name[2] == 0)) {
@@ -874,7 +864,7 @@ static int osd_dir_it_key_size(const struct lu_env *env, const struct dt_it *di)
        if ((rc = -zap_cursor_retrieve(it->ozi_zc, za)) == 0)
                rc = strlen(za->za_name);
 
        if ((rc = -zap_cursor_retrieve(it->ozi_zc, za)) == 0)
                rc = strlen(za->za_name);
 
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 3, 99, 0)
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 3, 90, 0)
        if (rc == 0 && za->za_name[0] == '.') {
                if (za->za_name[1] == 0 || (za->za_name[1] == '.' &&
                    za->za_name[2] == 0)) {
        if (rc == 0 && za->za_name[0] == '.') {
                if (za->za_name[1] == 0 || (za->za_name[1] == '.' &&
                    za->za_name[2] == 0)) {
index 914f988..d0e8e3f 100644 (file)
@@ -1044,7 +1044,6 @@ int osp_precreate_reserve(const struct lu_env *env, struct osp_device *d)
        struct l_wait_info       lwi;
        cfs_time_t               expire = cfs_time_shift(obd_timeout);
        int                      precreated, rc;
        struct l_wait_info       lwi;
        cfs_time_t               expire = cfs_time_shift(obd_timeout);
        int                      precreated, rc;
-       int                      count = 0;
 
        ENTRY;
 
 
        ENTRY;
 
@@ -1062,17 +1061,6 @@ int osp_precreate_reserve(const struct lu_env *env, struct osp_device *d)
        while ((rc = d->opd_pre_status) == 0 || rc == -ENOSPC ||
                rc == -ENODEV || rc == -EAGAIN) {
 
        while ((rc = d->opd_pre_status) == 0 || rc == -ENOSPC ||
                rc == -ENODEV || rc == -EAGAIN) {
 
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 3, 90, 0)
-               /*
-                * to address Andreas's concern on possible busy-loop
-                * between this thread and osp_precreate_send()
-                */
-               if (unlikely(count++ == 1000)) {
-                       osp_precreate_timeout_condition(d);
-                       LBUG();
-               }
-#endif
-
                /*
                 * increase number of precreations
                 */
                /*
                 * increase number of precreations
                 */