summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-snapshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c96
1 files changed, 0 insertions, 96 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index a130a78aace..78a4652cf41 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -904,76 +904,6 @@ out:
return ret;
}
-/*
- * This function validates the particulat snapshot with respect to the current
- * cluster. If the snapshot has ganesha enabled, and the cluster is not a nfs
- * ganesha cluster, we fail the validation. Other scenarios where either the
- * snapshot does not have ganesha enabled or it has and the cluster is a nfs
- * ganesha cluster, we pass the validation
- *
- * @param snap snap object of the snapshot to be validated
- * @return Negative value on Failure and 0 in success
- */
-int32_t
-glusterd_snapshot_validate_ganesha_conf (glusterd_snap_t *snap,
- char **op_errstr,
- uint32_t *op_errno)
-{
- int ret = -1;
- glusterd_volinfo_t *snap_vol = NULL;
- xlator_t *this = NULL;
-
- this = THIS;
- GF_VALIDATE_OR_GOTO ("snapshot", this, out);
- GF_VALIDATE_OR_GOTO (this->name, snap, out);
- GF_VALIDATE_OR_GOTO (this->name, op_errstr, out);
- GF_VALIDATE_OR_GOTO (this->name, op_errno, out);
-
- snap_vol = list_entry (snap->volumes.next,
- glusterd_volinfo_t, vol_list);
-
- GF_VALIDATE_OR_GOTO (this->name, snap_vol, out);
-
- /*
- * Check if the snapshot has ganesha enabled *
- */
- if (glusterd_check_ganesha_export(snap_vol) == _gf_false) {
- /*
- * If the snapshot has not been exported via ganesha *
- * then we can proceed. *
- */
- ret = 0;
- goto out;
- }
-
- /*
- * At this point we are certain that the snapshot has been exported *
- * via ganesha. So we check if the cluster is a nfs-ganesha cluster *
- * If it a nfs-ganesha cluster, then we proceed. Else we fail. *
- */
- if (glusterd_is_ganesha_cluster() != _gf_true) {
- ret = gf_asprintf (op_errstr, "Snapshot(%s) has a "
- "nfs-ganesha export conf file. "
- "cluster.enable-shared-storage and "
- "nfs-ganesha should be enabled "
- "before restoring this snapshot.",
- snap->snapname);
- *op_errno = EG_NOGANESHA;
- if (ret < 0) {
- goto out;
- }
-
- gf_msg (this->name, GF_LOG_ERROR, EINVAL,
- GD_MSG_NFS_GANESHA_DISABLED, "%s", *op_errstr);
- ret = -1;
- goto out;
- }
-
- ret = 0;
-out:
- return ret;
-}
-
/* This function is called before actual restore is taken place. This function
* will validate whether the snapshot volumes are ready to be restored or not.
*
@@ -1044,15 +974,6 @@ glusterd_snapshot_restore_prevalidate (dict_t *dict, char **op_errstr,
goto out;
}
- ret = glusterd_snapshot_validate_ganesha_conf (snap, op_errstr,
- op_errno);
- if (ret) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- GD_MSG_SNAPSHOT_OP_FAILED,
- "ganesha conf validation failed.");
- goto out;
- }
-
ret = dict_set_str (rsp_dict, "snapname", snapname);
if (ret) {
gf_msg (this->name, GF_LOG_ERROR, 0,
@@ -5450,13 +5371,6 @@ glusterd_do_snap_vol (glusterd_volinfo_t *origin_vol, glusterd_snap_t *snap,
}
- ret = glusterd_copy_nfs_ganesha_file (origin_vol, snap_vol);
- if (ret < 0) {
- gf_msg (this->name, GF_LOG_ERROR, 0,
- GD_MSG_VOL_OP_FAILED, "Failed to copy export "
- "file for volume %s", origin_vol->volname);
- goto out;
- }
glusterd_auth_set_username (snap_vol, username);
glusterd_auth_set_password (snap_vol, password);
@@ -10056,16 +9970,6 @@ gd_restore_snap_volume (dict_t *dict, dict_t *rsp_dict,
snap_vol->snapshot->snapname);
}
- ret = glusterd_restore_nfs_ganesha_file (orig_vol, snap);
- if (ret) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
- GD_MSG_SNAP_RESTORE_FAIL,
- "Failed to restore "
- "nfs-ganesha export file for snap %s",
- snap_vol->snapshot->snapname);
- goto out;
- }
-
/* Need not save cksum, as we will copy cksum file in *
* this function *
*/