Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
1aa0201f
Unverified
Commit
1aa0201f
authored
Jul 16, 2017
by
Christian Brauner
Committed by
Stéphane Graber
Aug 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
btrfs: simplify
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
d848b631
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
bdev.c
src/lxc/bdev/bdev.c
+0
-5
lxcbtrfs.c
src/lxc/bdev/lxcbtrfs.c
+15
-2
No files found.
src/lxc/bdev/bdev.c
View file @
1aa0201f
...
@@ -441,11 +441,6 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
...
@@ -441,11 +441,6 @@ struct bdev *bdev_copy(struct lxc_container *c0, const char *cname,
goto
err
;
goto
err
;
}
}
if
(
mkdir_p
(
new
->
dest
,
0755
)
<
0
)
{
ERROR
(
"Failed to create directory
\"
%s
\"
"
,
new
->
dest
);
goto
err
;
}
arg
.
src
=
orig
->
dest
;
arg
.
src
=
orig
->
dest
;
arg
.
dest
=
new
->
dest
;
arg
.
dest
=
new
->
dest
;
if
(
am_unpriv
())
if
(
am_unpriv
())
...
...
src/lxc/bdev/lxcbtrfs.c
View file @
1aa0201f
...
@@ -413,8 +413,19 @@ int btrfs_clonepaths(struct bdev *orig, struct bdev *new, const char *oldname,
...
@@ -413,8 +413,19 @@ int btrfs_clonepaths(struct bdev *orig, struct bdev *new, const char *oldname,
if
(
snap
)
{
if
(
snap
)
{
struct
rsync_data_char
sdata
;
struct
rsync_data_char
sdata
;
if
(
!
am_unpriv
())
if
(
!
am_unpriv
())
{
return
btrfs_snapshot
(
orig
->
dest
,
new
->
dest
);
ret
=
btrfs_snapshot
(
orig
->
dest
,
new
->
dest
);
if
(
ret
<
0
)
{
SYSERROR
(
"Failed to create btrfs snapshot "
"
\"
%s
\"
from
\"
%s
\"
"
,
new
->
dest
,
orig
->
dest
);
return
-
1
;
}
TRACE
(
"Created btrfs snapshot
\"
%s
\"
from
\"
%s
\"
"
,
new
->
dest
,
orig
->
dest
);
return
0
;
}
sdata
.
dest
=
new
->
dest
;
sdata
.
dest
=
new
->
dest
;
sdata
.
src
=
orig
->
dest
;
sdata
.
src
=
orig
->
dest
;
return
userns_exec_1
(
conf
,
btrfs_snapshot_wrapper
,
&
sdata
,
return
userns_exec_1
(
conf
,
btrfs_snapshot_wrapper
,
&
sdata
,
...
@@ -430,6 +441,8 @@ int btrfs_clonepaths(struct bdev *orig, struct bdev *new, const char *oldname,
...
@@ -430,6 +441,8 @@ int btrfs_clonepaths(struct bdev *orig, struct bdev *new, const char *oldname,
ret
=
btrfs_subvolume_create
(
new
->
dest
);
ret
=
btrfs_subvolume_create
(
new
->
dest
);
if
(
ret
<
0
)
if
(
ret
<
0
)
SYSERROR
(
"Failed to create btrfs subvolume
\"
%s
\"
"
,
new
->
dest
);
SYSERROR
(
"Failed to create btrfs subvolume
\"
%s
\"
"
,
new
->
dest
);
else
TRACE
(
"Created btrfs subvolume
\"
%s
\"
"
,
new
->
dest
);
return
ret
;
return
ret
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment