sysfs: Shadow directory support
[powerpc.git] / fs / sysfs / sysfs.h
index 3651ffb..fe1cbfd 100644 (file)
@@ -1,7 +1,8 @@
 
 extern struct vfsmount * sysfs_mount;
-extern kmem_cache_t *sysfs_dir_cachep;
+extern struct kmem_cache *sysfs_dir_cachep;
 
+extern void sysfs_delete_inode(struct inode *inode);
 extern struct inode * sysfs_new_inode(mode_t mode, struct sysfs_dirent *);
 extern int sysfs_create(struct dentry *, int mode, int (*init)(struct inode *));
 
@@ -10,7 +11,7 @@ extern int sysfs_make_dirent(struct sysfs_dirent *, struct dentry *, void *,
                                umode_t, int);
 
 extern int sysfs_add_file(struct dentry *, const struct attribute *, int);
-extern void sysfs_hash_and_remove(struct dentry * dir, const char * name);
+extern int sysfs_hash_and_remove(struct dentry * dir, const char * name);
 extern struct sysfs_dirent *sysfs_find(struct sysfs_dirent *dir, const char * name);
 
 extern int sysfs_create_subdir(struct kobject *, const char *, struct dentry **);
@@ -33,6 +34,22 @@ struct sysfs_symlink {
        struct kobject * target_kobj;
 };
 
+struct sysfs_buffer {
+       struct list_head                associates;
+       size_t                          count;
+       loff_t                          pos;
+       char                            * page;
+       struct sysfs_ops                * ops;
+       struct semaphore                sem;
+       int                             orphaned;
+       int                             needs_read_fill;
+       int                             event;
+};
+
+struct sysfs_buffer_collection {
+       struct list_head        associates;
+};
+
 static inline struct kobject * to_kobj(struct dentry * dentry)
 {
        struct sysfs_dirent * sd = dentry->d_fsdata;
@@ -96,3 +113,7 @@ static inline void sysfs_put(struct sysfs_dirent * sd)
                release_sysfs_dirent(sd);
 }
 
+static inline int sysfs_is_shadowed_inode(struct inode *inode)
+{
+       return S_ISDIR(inode->i_mode) && inode->i_op->follow_link;
+}