[prev in list] [next in list] [prev in thread] [next in thread]
List: openvz-criu
Subject: [CRIU] [PATCH 3/5] util: Add is_anon_inode helper
From: gorcunov () openvz ! org (Cyrill Gorcunov)
Date: 2012-04-27 18:13:37
Message-ID: 1335564808-10069-4-git-send-email-gorcunov () openvz ! org
[Download RAW message or body]
Will need it for eventpoll/eventfd/inotify.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
include/util.h | 2 ++
util.c | 9 +++++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/include/util.h b/include/util.h
index 60ff126..c15442d 100644
--- a/include/util.h
+++ b/include/util.h
@@ -11,6 +11,7 @@
#include <errno.h>
#include <sys/types.h>
+#include <sys/statfs.h>
#include <dirent.h>
#include "compiler.h"
@@ -276,5 +277,6 @@ static inline dev_t kdev_to_odev(u32 kdev)
}
int copy_file(int fd_in, int fd_out, size_t bytes);
+bool is_anon_inode(struct statfs *statfs);
#endif /* UTIL_H_ */
diff --git a/util.c b/util.c
index 82b06db..e2352f6 100644
--- a/util.c
+++ b/util.c
@@ -301,3 +301,12 @@ int copy_file(int fd_in, int fd_out, size_t bytes)
return 0;
}
+
+#ifndef ANON_INODE_FS_MAGIC
+# define ANON_INODE_FS_MAGIC 0x09041934
+#endif
+
+bool is_anon_inode(struct statfs *statfs)
+{
+ return statfs->f_type == ANON_INODE_FS_MAGIC;
+}
--
1.7.7.6
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic