]> sourceware.org Git - lvm2.git/commitdiff
Remove unused cache management from locking
authorDavid Teigland <teigland@redhat.com>
Fri, 8 Jun 2018 17:30:43 +0000 (12:30 -0500)
committerDavid Teigland <teigland@redhat.com>
Fri, 8 Jun 2018 17:30:43 +0000 (12:30 -0500)
This code was for managing lvmcache for clvm
and it no longer does anything.

lib/locking/locking.h
lib/metadata/metadata.c
tools/vgmerge.c
tools/vgrename.c

index f6a385953c437ae5300607541ea303307a24e10a..23636fc8de4dd683313d863d165cc29e9775e36f 100644 (file)
@@ -138,7 +138,6 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);
 #define LCK_VG_READ            (LCK_VG | LCK_READ | LCK_HOLD)
 #define LCK_VG_WRITE           (LCK_VG | LCK_WRITE | LCK_HOLD)
 #define LCK_VG_UNLOCK          (LCK_VG | LCK_UNLOCK)
-#define LCK_VG_DROP_CACHE      (LCK_VG | LCK_WRITE | LCK_CACHE)
 
 /* FIXME: LCK_HOLD abused here */
 #define LCK_VG_COMMIT          (LCK_VG | LCK_WRITE | LCK_CACHE | LCK_HOLD)
@@ -163,9 +162,6 @@ int check_lvm1_vg_inactive(struct cmd_context *cmd, const char *vgname);
                release_vg(vg); \
        } while (0)
 
-#define drop_cached_metadata(vg)       \
-       lock_vol((vg)->cmd, (vg)->name, LCK_VG_DROP_CACHE, NULL)
-
 int sync_local_dev_names(struct cmd_context* cmd);
 
 /* Process list of LVs */
index b7a73c52d4bcb49a7a69b739365addb3b86e305f..e45f5c12c70de05dcb4429bd2b5aa345d0c71516 100644 (file)
@@ -2915,11 +2915,6 @@ int vg_write(struct volume_group *vg)
                return 0;
        }
 
-       if (!drop_cached_metadata(vg)) {
-               log_error("Unable to drop cached metadata for VG %s.", vg->name);
-               return 0;
-       }
-
        if (critical_section())
                log_error(INTERNAL_ERROR
                          "Writing metadata in critical section.");
@@ -3077,11 +3072,6 @@ int vg_commit(struct volume_group *vg)
                _vg_move_cached_precommitted_to_committed(vg);
        }
 
-       /* If update failed, remove any cached precommitted metadata. */
-       if (!cache_updated && !drop_cached_metadata(vg))
-               log_error("Attempt to drop cached metadata failed "
-                         "after commit for VG %s.", vg->name);
-
        /* If at least one mda commit succeeded, it was committed */
        return cache_updated;
 }
@@ -3115,10 +3105,6 @@ void vg_revert(struct volume_group *vg)
                        stack;
                }
        }
-
-       if (!drop_cached_metadata(vg))
-               log_error("Attempt to drop cached metadata failed "
-                         "after reverted update for VG %s.", vg->name);
 }
 
 static int _check_mda_in_use(struct metadata_area *mda, void *_in_use)
@@ -3543,12 +3529,6 @@ static int _wipe_outdated_pvs(struct cmd_context *cmd, struct volume_group *vg,
                         pv_dev_name(pvl->pv), uuid, vg->name);
                if (!pv_write_orphan(cmd, pvl->pv))
                        return_0;
-
-               /* Refresh metadata after orphan write */
-               if (!drop_cached_metadata(vg)) {
-                       log_error("Unable to drop cached metadata for VG %s while wiping outdated PVs.", vg->name);
-                       return 0;
-               }
 next_pv:
                ;
        }
index 920ed73c572a2a7a865006d85220d7d339af8665..eab3d56f6532219d4589f9f4e042f8f8f3269871 100644 (file)
@@ -103,9 +103,6 @@ static int _vgmerge_single(struct cmd_context *cmd, const char *vg_name_to,
        if (!archive(vg_from) || !archive(vg_to))
                goto_bad;
 
-       if (!drop_cached_metadata(vg_from))
-               stack;
-
        if (!_vgmerge_select_pool_metadata_spare(cmd, vg_to, vg_from))
                goto_bad;
 
index bbc30870d5c686c6671de8fa84d38ce83f9675dd..2e6157f37a38e919fe98cc043a0289e75ff1480d 100644 (file)
@@ -108,10 +108,6 @@ static int _vgrename_single(struct cmd_context *cmd, const char *vg_name,
        if (!archive(vg))
                goto error;
 
-       /* Remove references based on old name */
-       if (!drop_cached_metadata(vg))
-               stack;
-
        if (!lockd_rename_vg_before(cmd, vg)) {
                stack;
                goto error;
This page took 0.048186 seconds and 5 git commands to generate.