function versioningPreprocessing(bucketName, bucketMD, objectKey, objMD,
    log, callback) {
    const mst = getMasterState(objMD);
    const vCfg = bucketMD.getVersioningConfiguration();
    // bucket is not versioning configured
    if (!vCfg) {
        const options = { dataToDelete: mst.objLocation };
        return process.nextTick(callback, null, options);
    }
    // bucket is versioning configured
    const { options, nullVersionId, delOptions } =
          processVersioningState(mst, vCfg.Status, config.nullVersionCompatMode);
    return async.series([
        function storeNullVersionMD(next) {
            if (!nullVersionId) {
                return process.nextTick(next);
            }
            return _storeNullVersionMD(bucketName, objectKey, nullVersionId, objMD, log, next);
        },
        function prepareNullVersionDeletion(next) {
            if (!delOptions) {
                return process.nextTick(next);
            }
            return _prepareNullVersionDeletion(
                bucketName, objectKey, delOptions, mst, log,
                (err, nullOptions) => {
                    if (err) {
                        return next(err);
                    }
                    Object.assign(options, nullOptions);
                    return next();
                });
        },
        function deleteNullVersionMD(next) {
            if (delOptions &&
                delOptions.versionId &&
                delOptions.versionId !== 'null') {
                // backward-compat: delete old null versioned key
                return _deleteNullVersionMD(
                    bucketName, objectKey, { versionId: delOptions.versionId, overheadField }, log, next);
            }
            return process.nextTick(next);
        },
    ], err => {
        // it's possible there was a prior request that deleted the
        // null version, so proceed with putting a new version
        if (err && err.is.NoSuchKey) {
            return callback(null, options);
        }
        return callback(err, options);
    });
}
versioningPreprocessing - return versioning information for S3 to handle
creation of new versions and manage deletion of old data and metadata
@param {string} bucketName - name of bucket
@param {object} bucketMD - bucket metadata
@param {string} objectKey - name of object
@param {object} objMD - obj metadata
@param {RequestLogger} log - logger instance
@param {function} callback - callback
@return {undefined} and call callback with params (err, options):
options.dataToDelete - (array/undefined) location of data to delete
options.versionId - specific versionId to overwrite in metadata
 ('' overwrites the master version)
options.versioning - (true/undefined) metadata instruction to create new ver
options.isNull - (true/undefined) whether new version is null or not