From 5dc8bf8132d59c03fe2562bce165c2f03f021687 Mon Sep 17 00:00:00 2001 From: Davide Libenzi Date: Thu, 10 May 2007 22:23:11 -0700 Subject: signal/timer/event fds: anonymous inode source This patch add an anonymous inode source, to be used for files that need and inode only in order to create a file*. We do not care of having an inode for each file, and we do not even care of having different names in the associated dentries (dentry names will be same for classes of file*). This allow code reuse, and will be used by epoll, signalfd and timerfd (and whatever else there'll be). Signed-off-by: Davide Libenzi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/anon_inodes.h | 16 ++++++++++++++++ include/linux/magic.h | 1 + 2 files changed, 17 insertions(+) create mode 100644 include/linux/anon_inodes.h (limited to 'include') diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h new file mode 100644 index 00000000000..b2e1ba325b9 --- /dev/null +++ b/include/linux/anon_inodes.h @@ -0,0 +1,16 @@ +/* + * include/linux/anon_inodes.h + * + * Copyright (C) 2007 Davide Libenzi + * + */ + +#ifndef _LINUX_ANON_INODES_H +#define _LINUX_ANON_INODES_H + +int anon_inode_getfd(int *pfd, struct inode **pinode, struct file **pfile, + const char *name, const struct file_operations *fops, + void *priv); + +#endif /* _LINUX_ANON_INODES_H */ + diff --git a/include/linux/magic.h b/include/linux/magic.h index a9c6567fe70..9d713c03e3d 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h @@ -14,6 +14,7 @@ #define ISOFS_SUPER_MAGIC 0x9660 #define JFFS2_SUPER_MAGIC 0x72b6 #define KVMFS_SUPER_MAGIC 0x19700426 +#define ANON_INODE_FS_MAGIC 0x09041934 #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ -- cgit v1.2.3