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
ca9055b4
Unverified
Commit
ca9055b4
authored
Feb 05, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mount_utils: kill mount_at()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
a099c5db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
60 deletions
+0
-60
mount_utils.c
src/lxc/mount_utils.c
+0
-55
mount_utils.h
src/lxc/mount_utils.h
+0
-5
No files found.
src/lxc/mount_utils.c
View file @
ca9055b4
...
@@ -139,61 +139,6 @@ int mount_filesystem(const char *fs_name, const char *path, unsigned int attr_fl
...
@@ -139,61 +139,6 @@ int mount_filesystem(const char *fs_name, const char *path, unsigned int attr_fl
return
mount
(
"none"
,
path
,
fs_name
,
old_flags
,
NULL
);
return
mount
(
"none"
,
path
,
fs_name
,
old_flags
,
NULL
);
}
}
int
mount_at
(
int
dfd
,
const
char
*
src_under_dfd
,
const
char
*
dst_under_dfd
,
__u64
o_flags
,
__u64
resolve_flags
,
const
char
*
fstype
,
unsigned
int
mnt_flags
,
const
void
*
data
)
{
__do_close
int
source_fd
=
-
EBADF
,
target_fd
=
-
EBADF
;
struct
lxc_open_how
how
=
{
.
flags
=
o_flags
,
.
resolve
=
resolve_flags
,
};
int
ret
;
char
src_buf
[
LXC_PROC_PID_FD_LEN
],
dst_buf
[
LXC_PROC_PID_FD_LEN
];
if
(
dfd
<
0
)
return
ret_errno
(
EINVAL
);
if
(
!
is_empty_string
(
src_buf
)
&&
*
src_buf
==
'/'
)
return
log_error_errno
(
-
EINVAL
,
EINVAL
,
"Absolute path specified"
);
if
(
!
is_empty_string
(
src_under_dfd
))
{
source_fd
=
openat2
(
dfd
,
src_under_dfd
,
&
how
,
sizeof
(
how
));
if
(
source_fd
<
0
)
return
-
errno
;
ret
=
snprintf
(
src_buf
,
sizeof
(
src_buf
),
"/proc/self/fd/%d"
,
source_fd
);
if
(
ret
<
0
||
ret
>=
sizeof
(
src_buf
))
return
-
EIO
;
}
if
(
!
is_empty_string
(
dst_under_dfd
))
{
target_fd
=
openat2
(
dfd
,
dst_under_dfd
,
&
how
,
sizeof
(
how
));
if
(
target_fd
<
0
)
return
log_error_errno
(
-
errno
,
errno
,
"Failed to open %d(%s)"
,
dfd
,
dst_under_dfd
);
TRACE
(
"Mounting %d(%s) through /proc/self/fd/%d"
,
target_fd
,
dst_under_dfd
,
target_fd
);
ret
=
snprintf
(
dst_buf
,
sizeof
(
dst_buf
),
"/proc/self/fd/%d"
,
target_fd
);
}
else
{
TRACE
(
"Mounting %d through /proc/self/fd/%d"
,
dfd
,
dfd
);
ret
=
snprintf
(
dst_buf
,
sizeof
(
dst_buf
),
"/proc/self/fd/%d"
,
dfd
);
}
if
(
ret
<
0
||
ret
>=
sizeof
(
dst_buf
))
return
-
EIO
;
if
(
!
is_empty_string
(
src_buf
))
ret
=
mount
(
src_buf
,
dst_buf
,
fstype
,
mnt_flags
,
data
);
else
ret
=
mount
(
NULL
,
dst_buf
,
fstype
,
mnt_flags
,
data
);
return
ret
;
}
static
int
__fs_prepare
(
const
char
*
fs_name
,
int
fd_from
)
static
int
__fs_prepare
(
const
char
*
fs_name
,
int
fd_from
)
{
{
__do_close
int
fd_fs
=
-
EBADF
;
__do_close
int
fd_fs
=
-
EBADF
;
...
...
src/lxc/mount_utils.h
View file @
ca9055b4
...
@@ -152,11 +152,6 @@ __hidden extern int mnt_attributes_old(unsigned int new_flags, unsigned int *old
...
@@ -152,11 +152,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_filesystem
(
const
char
*
fs_name
,
const
char
*
path
,
unsigned
int
attr_flags
);
__hidden
extern
int
mount_at
(
int
dfd
,
const
char
*
src_under_dfd
,
const
char
*
dst_under_dfd
,
__u64
o_flags
,
__u64
resolve_flags
,
const
char
*
fstype
,
unsigned
int
mnt_flags
,
const
void
*
data
);
__hidden
extern
int
mount_from_at
(
int
dfd_from
,
const
char
*
path_from
,
__hidden
extern
int
mount_from_at
(
int
dfd_from
,
const
char
*
path_from
,
__u64
o_flags_from
,
__u64
resolve_flags_from
,
__u64
o_flags_from
,
__u64
resolve_flags_from
,
int
dfd_to
,
const
char
*
path_to
,
int
dfd_to
,
const
char
*
path_to
,
...
...
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