[CRIU] [PATCH 3/5] util: Add is_anon_inode helper

Cyrill Gorcunov gorcunov at openvz.org
Fri Apr 27 18:13:26 EDT 2012


Will need it for eventpoll/eventfd/inotify.

Signed-off-by: Cyrill Gorcunov <gorcunov at 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



More information about the CRIU mailing list