shadow_copy2: use stored mount_point instead of recalculating.
authorMichael Adam <obnox@samba.org>
Thu, 30 May 2013 22:46:01 +0000 (00:46 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 4 Oct 2013 20:21:33 +0000 (09:21 +1300)
In the case of snapdirseverywhere but NOT crossmountpoints.

This spares stat calls.
And is the only correct thing to do if the mount point was
specified in the configuration.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/modules/vfs_shadow_copy2.c

index 950f2908465cb3c527794b9d30cea792e8947cf7..ebc50e9076e85087a8d52dc5775a0d705fb606c2 100644 (file)
@@ -577,15 +577,7 @@ static char *shadow_copy2_convert(TALLOC_CTX *mem_ctx,
        min_offset = 0;
 
        if (!config->crossmountpoints) {
-               char *mount_point;
-
-               mount_point = shadow_copy2_find_mount_point(talloc_tos(),
-                                                           handle);
-               if (mount_point == NULL) {
-                       goto fail;
-               }
-               min_offset = strlen(mount_point);
-               TALLOC_FREE(mount_point);
+               min_offset = strlen(config->mount_point);
        }
 
        memcpy(converted, path, pathlen+1);