From 27661857721e92f2ff99ebe7f3a72bac6f01fa50 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Tue, 13 Dec 2011 11:24:16 -0500 Subject: [PATCH] volser: allow clonevol purge id to be new id effectively the same functionality that reclone already uses, but for some reason we artificially limit it out of clone despite the interface being there for it. it used to be there. put it back. Reviewed-on: http://gerrit.openafs.org/6250 Tested-by: BuildBot Reviewed-by: Alistair Ferguson Reviewed-by: Derrick Brashear (cherry picked from commit 641c67473615e80cfb8cf1e67636a82e42e5c899) Change-Id: I31df948a21639bd93c573c77207f0f6c9e43deed Reviewed-on: http://gerrit.openafs.org/6761 Tested-by: BuildBot Reviewed-by: Alistair Ferguson Reviewed-by: Derrick Brashear --- src/volser/volprocs.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 89196911b8..7f7aaa6fb1 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -772,13 +772,17 @@ VolClone(struct rx_call *acid, afs_int32 atrans, afs_uint32 purgeId, salv_vp = originalvp; #endif - newvp = - VCreateVolume(&error, originalvp->partition->name, newId, - V_parentId(originalvp)); - if (error) { - Log("1 Volser: Clone: Couldn't create new volume; clone aborted\n"); - newvp = (Volume *) 0; - goto fail; + if (purgeId == newId) { + newvp = purgevp; + } else { + newvp = + VCreateVolume(&error, originalvp->partition->name, newId, + V_parentId(originalvp)); + if (error) { + Log("1 Volser: Clone: Couldn't create new volume; clone aborted\n"); + newvp = (Volume *) 0; + goto fail; + } } if (newType == readonlyVolume) V_cloneId(originalvp) = newId;