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: openafs-stable-1_8_0pre1~2747 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=641c67473615e80cfb8cf1e67636a82e42e5c899 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. Change-Id: I22868c41f8d3b920ba61d01e5334ff2320b38376 Reviewed-on: http://gerrit.openafs.org/6250 Tested-by: BuildBot Reviewed-by: Alistair Ferguson Reviewed-by: Derrick Brashear --- diff --git a/src/volser/volprocs.c b/src/volser/volprocs.c index cdf8ce8..29d3229 100644 --- a/src/volser/volprocs.c +++ b/src/volser/volprocs.c @@ -782,13 +782,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;