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
55a85f4a
Unverified
Commit
55a85f4a
authored
Feb 05, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mount_utils: kill mount_from_at()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
d2c885f1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
55 deletions
+0
-55
mount_utils.c
src/lxc/mount_utils.c
+0
-49
mount_utils.h
src/lxc/mount_utils.h
+0
-6
No files found.
src/lxc/mount_utils.c
View file @
55a85f4a
...
...
@@ -255,55 +255,6 @@ int fs_attach(int fd_fs,
return
0
;
}
int
mount_from_at
(
int
dfd_from
,
const
char
*
path_from
,
__u64
o_flags_from
,
__u64
resolve_flags_from
,
int
dfd_to
,
const
char
*
path_to
,
__u64
o_flags_to
,
__u64
resolve_flags_to
,
const
char
*
fstype
,
unsigned
int
mnt_flags
,
const
void
*
data
)
{
__do_close
int
fd_from
=
-
EBADF
,
fd_to
=
-
EBADF
;
struct
lxc_open_how
how
=
{};
int
ret
;
char
src_buf
[
LXC_PROC_PID_FD_LEN
],
dst_buf
[
LXC_PROC_PID_FD_LEN
];
if
(
is_empty_string
(
path_from
))
{
ret
=
snprintf
(
src_buf
,
sizeof
(
src_buf
),
"/proc/self/fd/%d"
,
dfd_from
);
}
else
{
how
.
flags
=
o_flags_from
;
how
.
resolve
=
resolve_flags_from
;
fd_from
=
openat2
(
dfd_from
,
path_from
,
&
how
,
sizeof
(
how
));
if
(
fd_from
<
0
)
return
-
errno
;
ret
=
snprintf
(
src_buf
,
sizeof
(
src_buf
),
"/proc/self/fd/%d"
,
fd_from
);
}
if
(
ret
<
0
||
ret
>=
sizeof
(
src_buf
))
return
-
EIO
;
if
(
is_empty_string
(
path_to
))
{
ret
=
snprintf
(
dst_buf
,
sizeof
(
dst_buf
),
"/proc/self/fd/%d"
,
dfd_to
);
}
else
{
how
.
flags
=
o_flags_to
;
how
.
resolve
=
resolve_flags_to
;
fd_to
=
openat2
(
dfd_to
,
path_to
,
&
how
,
sizeof
(
how
));
if
(
fd_to
<
0
)
return
-
errno
;
ret
=
snprintf
(
dst_buf
,
sizeof
(
dst_buf
),
"/proc/self/fd/%d"
,
fd_to
);
}
if
(
ret
<
0
||
ret
>=
sizeof
(
src_buf
))
return
-
EIO
;
if
(
is_empty_string
(
src_buf
))
ret
=
mount
(
NULL
,
dst_buf
,
fstype
,
mnt_flags
,
data
);
else
ret
=
mount
(
src_buf
,
dst_buf
,
fstype
,
mnt_flags
,
data
);
return
ret
;
}
int
fd_bind_mount
(
int
dfd_from
,
const
char
*
path_from
,
__u64
o_flags_from
,
__u64
resolve_flags_from
,
int
dfd_to
,
const
char
*
path_to
,
...
...
src/lxc/mount_utils.h
View file @
55a85f4a
...
...
@@ -157,12 +157,6 @@ __hidden extern int mnt_attributes_old(unsigned int new_flags, unsigned int *old
__hidden
extern
int
mount_filesystem
(
const
char
*
fs_name
,
const
char
*
path
,
unsigned
int
attr_flags
);
__hidden
extern
int
mount_from_at
(
int
dfd_from
,
const
char
*
path_from
,
__u64
o_flags_from
,
__u64
resolve_flags_from
,
int
dfd_to
,
const
char
*
path_to
,
__u64
o_flags_to
,
__u64
resolve_flags_to
,
const
char
*
fstype
,
unsigned
int
mnt_flags
,
const
void
*
data
);
__hidden
extern
int
fs_prepare
(
const
char
*
fs_name
,
int
dfd_from
,
const
char
*
path_from
,
__u64
o_flags_from
,
__u64
resolve_flags_from
);
...
...
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