Commit 49166b20 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

util: Add is_anon_inode helper

Will need it for eventpoll/eventfd/inotify.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 26a53837
......@@ -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_ */
......@@ -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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment