rgw: bucket link: use data from bucket_info to rewrite bucket_endpoint.
The bucket link command was doing a fetch of the entrypoint late
in the link process. This makes it harder to do "bucket move"
functionality, because then it would need to know the old
bucket late in the process. The bucketinfo structure has
all the data elements necessary to recreate the endpoint,
so the changes here arrange to just use that data.
In order to write the object it's also necessary to propagate
xattrs. The only xattr that seems to be present on the endpoint
is "ceph.objclass.version", so that's what this copies out.
It appears that attribute may be set set separately by cls,
so I'm not sure this is actually necessary. However, the
old code would have written it, so this code preserves
that behavior.
Fixes: http://tracker.ceph.com/issues/35885 Signed-off-by: Marcus Watts <mwatts@redhat.com>