linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / include / linux / relayfs_fs.h
similarity index 87%
rename from include/linux/relay.h
rename to include/linux/relayfs_fs.h
index 4bcc153..7342e66 100644 (file)
@@ -1,14 +1,14 @@
 /*
- * linux/include/linux/relay.h
+ * linux/include/linux/relayfs_fs.h
  *
  * Copyright (C) 2002, 2003 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp
  * Copyright (C) 1999, 2000, 2001, 2002 - Karim Yaghmour (karim@opersys.com)
  *
- * CONFIG_RELAY definitions and declarations
+ * RelayFS definitions and declarations
  */
 
-#ifndef _LINUX_RELAY_H
-#define _LINUX_RELAY_H
+#ifndef _LINUX_RELAYFS_FS_H
+#define _LINUX_RELAYFS_FS_H
 
 #include <linux/config.h>
 #include <linux/types.h>
@@ -19,9 +19,6 @@
 #include <linux/poll.h>
 #include <linux/kref.h>
 
-/* Needs a _much_ better name... */
-#define FIX_SIZE(x) ((((x) - 1) & PAGE_MASK) + PAGE_SIZE)
-
 /*
  * Tracks changes to rchan/rchan_buf structs
  */
@@ -95,26 +92,26 @@ struct rchan_callbacks
                             size_t prev_padding);
 
        /*
-        * buf_mapped - relay buffer mmap notification
+        * buf_mapped - relayfs buffer mmap notification
         * @buf: the channel buffer
-        * @filp: relay file pointer
+        * @filp: relayfs file pointer
         *
-        * Called when a relay file is successfully mmapped
+        * Called when a relayfs file is successfully mmapped
         */
         void (*buf_mapped)(struct rchan_buf *buf,
                           struct file *filp);
 
        /*
-        * buf_unmapped - relay buffer unmap notification
+        * buf_unmapped - relayfs buffer unmap notification
         * @buf: the channel buffer
-        * @filp: relay file pointer
+        * @filp: relayfs file pointer
         *
-        * Called when a relay file is successfully unmapped
+        * Called when a relayfs file is successfully unmapped
         */
         void (*buf_unmapped)(struct rchan_buf *buf,
                             struct file *filp);
        /*
-        * create_buf_file - create file to represent a relay channel buffer
+        * create_buf_file - create file to represent a relayfs channel buffer
         * @filename: the name of the file to create
         * @parent: the parent of the file to create
         * @mode: the mode of the file to create
@@ -124,7 +121,7 @@ struct rchan_callbacks
         * Called during relay_open(), once for each per-cpu buffer,
         * to allow the client to create a file to be used to
         * represent the corresponding channel buffer.  If the file is
-        * created outside of relay, the parent must also exist in
+        * created outside of relayfs, the parent must also exist in
         * that filesystem.
         *
         * The callback should return the dentry of the file created
@@ -143,7 +140,7 @@ struct rchan_callbacks
                                          int *is_global);
 
        /*
-        * remove_buf_file - remove file representing a relay channel buffer
+        * remove_buf_file - remove file representing a relayfs channel buffer
         * @dentry: the dentry of the file to remove
         *
         * Called during relay_close(), once for each per-cpu buffer,
@@ -156,7 +153,7 @@ struct rchan_callbacks
 };
 
 /*
- * CONFIG_RELAY kernel API, kernel/relay.c
+ * relayfs kernel API, fs/relayfs/relay.c
  */
 
 struct rchan *relay_open(const char *base_filename,
@@ -174,6 +171,15 @@ extern int relay_buf_full(struct rchan_buf *buf);
 
 extern size_t relay_switch_subbuf(struct rchan_buf *buf,
                                  size_t length);
+extern struct dentry *relayfs_create_dir(const char *name,
+                                        struct dentry *parent);
+extern int relayfs_remove_dir(struct dentry *dentry);
+extern struct dentry *relayfs_create_file(const char *name,
+                                         struct dentry *parent,
+                                         int mode,
+                                         struct file_operations *fops,
+                                         void *data);
+extern int relayfs_remove_file(struct dentry *dentry);
 
 /**
  *     relay_write - write data into the channel
@@ -273,9 +279,9 @@ static inline void subbuf_start_reserve(struct rchan_buf *buf,
 }
 
 /*
- * exported relay file operations, kernel/relay.c
+ * exported relay file operations, fs/relayfs/inode.c
  */
 extern struct file_operations relay_file_operations;
 
-#endif /* _LINUX_RELAY_H */
+#endif /* _LINUX_RELAYFS_FS_H */