]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/sysfs/sysfs.h
sysfs: move release_sysfs_dirent() to dir.c
[linux-2.6-omap-h63xx.git] / fs / sysfs / sysfs.h
index fe1cbfd208ed9828993623c9aaa16949cd379db3..687d959f606d10093bab92a17a23affe320c435d 100644 (file)
@@ -1,3 +1,15 @@
+struct sysfs_dirent {
+       atomic_t                s_count;
+       struct list_head        s_sibling;
+       struct list_head        s_children;
+       void                    * s_element;
+       int                     s_type;
+       umode_t                 s_mode;
+       ino_t                   s_ino;
+       struct dentry           * s_dentry;
+       struct iattr            * s_iattr;
+       atomic_t                s_event;
+};
 
 extern struct vfsmount * sysfs_mount;
 extern struct kmem_cache *sysfs_dir_cachep;
@@ -6,6 +18,7 @@ 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 *));
 
+extern void release_sysfs_dirent(struct sysfs_dirent * sd);
 extern int sysfs_dirent_exist(struct sysfs_dirent *, const unsigned char *);
 extern int sysfs_make_dirent(struct sysfs_dirent *, struct dentry *, void *,
                                umode_t, int);
@@ -21,13 +34,14 @@ extern const unsigned char * sysfs_get_name(struct sysfs_dirent *sd);
 extern void sysfs_drop_dentry(struct sysfs_dirent *sd, struct dentry *parent);
 extern int sysfs_setattr(struct dentry *dentry, struct iattr *iattr);
 
+extern spinlock_t sysfs_lock;
 extern struct rw_semaphore sysfs_rename_sem;
 extern struct super_block * sysfs_sb;
 extern const struct file_operations sysfs_dir_operations;
 extern const struct file_operations sysfs_file_operations;
 extern const struct file_operations bin_fops;
-extern struct inode_operations sysfs_dir_inode_operations;
-extern struct inode_operations sysfs_symlink_inode_operations;
+extern const struct inode_operations sysfs_dir_inode_operations;
+extern const struct inode_operations sysfs_symlink_inode_operations;
 
 struct sysfs_symlink {
        char * link_name;
@@ -86,18 +100,6 @@ static inline struct kobject *sysfs_get_kobject(struct dentry *dentry)
        return kobj;
 }
 
-static inline void release_sysfs_dirent(struct sysfs_dirent * sd)
-{
-       if (sd->s_type & SYSFS_KOBJ_LINK) {
-               struct sysfs_symlink * sl = sd->s_element;
-               kfree(sl->link_name);
-               kobject_put(sl->target_kobj);
-               kfree(sl);
-       }
-       kfree(sd->s_iattr);
-       kmem_cache_free(sysfs_dir_cachep, sd);
-}
-
 static inline struct sysfs_dirent * sysfs_get(struct sysfs_dirent * sd)
 {
        if (sd) {