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
d4e07569
Unverified
Commit
d4e07569
authored
Mar 17, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mount_utils: add helper to determine whether new mount api supports bind mounts
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
79defd88
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
mount_utils.c
src/lxc/mount_utils.c
+25
-0
mount_utils.h
src/lxc/mount_utils.h
+1
-0
No files found.
src/lxc/mount_utils.c
View file @
d4e07569
...
@@ -488,3 +488,28 @@ bool can_use_mount_api(void)
...
@@ -488,3 +488,28 @@ bool can_use_mount_api(void)
return
supported
==
1
;
return
supported
==
1
;
}
}
bool
can_use_bind_mounts
(
void
)
{
static
int
supported
=
-
1
;
if
(
supported
==
-
1
)
{
int
ret
;
if
(
!
can_use_mount_api
())
{
supported
=
0
;
return
false
;
}
ret
=
mount_setattr
(
-
EBADF
,
NULL
,
0
,
NULL
,
0
);
if
(
!
ret
||
errno
==
ENOSYS
)
{
supported
=
0
;
return
false
;
}
supported
=
1
;
TRACE
(
"Kernel supports bind mounts in the new mount api"
);
}
return
supported
==
1
;
}
src/lxc/mount_utils.h
View file @
d4e07569
...
@@ -206,5 +206,6 @@ __hidden extern unsigned long add_required_remount_flags(const char *s,
...
@@ -206,5 +206,6 @@ __hidden extern unsigned long add_required_remount_flags(const char *s,
unsigned
long
flags
);
unsigned
long
flags
);
__hidden
extern
bool
can_use_mount_api
(
void
);
__hidden
extern
bool
can_use_mount_api
(
void
);
__hidden
extern
bool
can_use_bind_mounts
(
void
);
#endif
/* __LXC_MOUNT_UTILS_H */
#endif
/* __LXC_MOUNT_UTILS_H */
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