Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 579856 | Differences between
and this patch

Collapse All | Expand All

(-)docker-1.10.3.orig/src/github.com/docker/docker/daemon/graphdriver/btrfs/btrfs.go (-3 / +8 lines)
Lines 7-12 package btrfs Link Here
7
#include <dirent.h>
7
#include <dirent.h>
8
#include <btrfs/ioctl.h>
8
#include <btrfs/ioctl.h>
9
#include <btrfs/ctree.h>
9
#include <btrfs/ctree.h>
10
11
static void set_name_btrfs_ioctl_vol_args_v2(struct btrfs_ioctl_vol_args_v2* btrfs_struct, const char* value) {
12
    snprintf(btrfs_struct->name, BTRFS_SUBVOL_NAME_MAX, "%s", value);
13
}
10
*/
14
*/
11
import "C"
15
import "C"
12
16
Lines 160-168 func subvolSnapshot(src, dest, name stri Link Here
160
164
161
	var args C.struct_btrfs_ioctl_vol_args_v2
165
	var args C.struct_btrfs_ioctl_vol_args_v2
162
	args.fd = C.__s64(getDirFd(srcDir))
166
	args.fd = C.__s64(getDirFd(srcDir))
163
	for i, c := range []byte(name) {
167
164
		args.name[i] = C.char(c)
168
	var cs = C.CString(name)
165
	}
169
	C.set_name_btrfs_ioctl_vol_args_v2(&args, cs)
170
	C.free(unsafe.Pointer(cs))
166
171
167
	_, _, errno := syscall.Syscall(syscall.SYS_IOCTL, getDirFd(destDir), C.BTRFS_IOC_SNAP_CREATE_V2,
172
	_, _, errno := syscall.Syscall(syscall.SYS_IOCTL, getDirFd(destDir), C.BTRFS_IOC_SNAP_CREATE_V2,
168
		uintptr(unsafe.Pointer(&args)))
173
		uintptr(unsafe.Pointer(&args)))

Return to bug 579856