From: Derrick Brashear Date: Tue, 13 Dec 2011 16:24:16 +0000 (-0500) Subject: volser: allow clonevol purge id to be new id X-Git-Tag: upstream/1.6.1.pre4^2~62 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=27661857721e92f2ff99ebe7f3a72bac6f01fa50;p=packages%2Fo%2Fopenafs.git 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 --- diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index 89196911b..7f7aaa6fb 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;