shm: add sealing API
[pandora-kernel.git] / include / linux / shmem_fs.h
index 6f10c9c..e599145 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __SHMEM_FS_H
 #define __SHMEM_FS_H
 
+#include <linux/file.h>
 #include <linux/swap.h>
 #include <linux/mempolicy.h>
 #include <linux/pagemap.h>
@@ -10,6 +11,7 @@
 
 struct shmem_inode_info {
        spinlock_t              lock;
+       unsigned int            seals;          /* shmem seals */
        unsigned long           flags;
        unsigned long           alloced;        /* data pages alloced to file */
        union {
@@ -61,4 +63,19 @@ static inline struct page *shmem_read_mapping_page(
                                        mapping_gfp_mask(mapping));
 }
 
+#ifdef CONFIG_TMPFS
+
+extern int shmem_add_seals(struct file *file, unsigned int seals);
+extern int shmem_get_seals(struct file *file);
+extern long shmem_fcntl(struct file *file, unsigned int cmd, unsigned long arg);
+
+#else
+
+static inline long shmem_fcntl(struct file *f, unsigned int c, unsigned long a)
+{
+       return -EINVAL;
+}
+
+#endif
+
 #endif