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
3b474fb6
Unverified
Commit
3b474fb6
authored
Aug 01, 2017
by
Christian Brauner
Committed by
Stéphane Graber
Aug 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
utils: switch to has_fs_type()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
b6922297
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
utils.c
src/lxc/utils.c
+12
-11
utils.h
src/lxc/utils.h
+1
-0
No files found.
src/lxc/utils.c
View file @
3b474fb6
...
@@ -42,7 +42,6 @@
...
@@ -42,7 +42,6 @@
#include <sys/prctl.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/vfs.h>
#include <sys/wait.h>
#include <sys/wait.h>
#include "log.h"
#include "log.h"
...
@@ -183,22 +182,24 @@ static int _recursive_rmdir(char *dirname, dev_t pdev,
...
@@ -183,22 +182,24 @@ static int _recursive_rmdir(char *dirname, dev_t pdev,
return
failed
?
-
1
:
0
;
return
failed
?
-
1
:
0
;
}
}
/* we have two different magic values for overlayfs, yay */
/* We have two different magic values for overlayfs, yay. */
#ifndef OVERLAYFS_SUPER_MAGIC
#define OVERLAYFS_SUPER_MAGIC 0x794c764f
#define OVERLAYFS_SUPER_MAGIC 0x794c764f
#endif
#ifndef OVERLAY_SUPER_MAGIC
#define OVERLAY_SUPER_MAGIC 0x794c7630
#define OVERLAY_SUPER_MAGIC 0x794c7630
/*
#endif
* In overlayfs, st_dev is unreliable. so on overlayfs we don't do
* the lxc_rmdir_onedev()
/* In overlayfs, st_dev is unreliable. So on overlayfs we don't do the
* lxc_rmdir_onedev()
*/
*/
static
bool
is_native_overlayfs
(
const
char
*
path
)
static
bool
is_native_overlayfs
(
const
char
*
path
)
{
{
struct
statfs
sb
;
if
(
has_fs_type
(
path
,
OVERLAY_SUPER_MAGIC
)
||
has_fs_type
(
path
,
OVERLAYFS_SUPER_MAGIC
))
if
(
statfs
(
path
,
&
sb
)
<
0
)
return
false
;
if
(
sb
.
f_type
==
OVERLAYFS_SUPER_MAGIC
||
sb
.
f_type
==
OVERLAY_SUPER_MAGIC
)
return
true
;
return
true
;
return
false
;
return
false
;
}
}
...
...
src/lxc/utils.h
View file @
3b474fb6
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include <stdbool.h>
#include <stdbool.h>
#include <unistd.h>
#include <unistd.h>
#include <linux/loop.h>
#include <linux/loop.h>
#include <linux/magic.h>
#include <sys/syscall.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/vfs.h>
#include <sys/vfs.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