sata_promise: kill qc->nsect
[powerpc.git] / fs / sysfs / mount.c
index 40190c4..f6a87a8 100644 (file)
@@ -8,6 +8,7 @@
 #include <linux/mount.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
+#include <asm/semaphore.h>
 
 #include "sysfs.h"
 
 
 struct vfsmount *sysfs_mount;
 struct super_block * sysfs_sb = NULL;
-kmem_cache_t *sysfs_dir_cachep;
+struct kmem_cache *sysfs_dir_cachep;
+
+static void sysfs_clear_inode(struct inode *inode);
 
 static struct super_operations sysfs_ops = {
        .statfs         = simple_statfs,
-       .drop_inode     = generic_delete_inode,
+       .drop_inode     = sysfs_delete_inode,
+       .clear_inode    = sysfs_clear_inode,
 };
 
 static struct sysfs_dirent sysfs_root = {
@@ -31,6 +35,11 @@ static struct sysfs_dirent sysfs_root = {
        .s_iattr        = NULL,
 };
 
+static void sysfs_clear_inode(struct inode *inode)
+{
+       kfree(inode->i_private);
+}
+
 static int sysfs_fill_super(struct super_block *sb, void *data, int silent)
 {
        struct inode *inode;
@@ -49,7 +58,7 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent)
                inode->i_op = &sysfs_dir_inode_operations;
                inode->i_fop = &sysfs_dir_operations;
                /* directory inodes start off with i_nlink == 2 (for "." entry) */
-               inode->i_nlink++;       
+               inc_nlink(inode);
        } else {
                pr_debug("sysfs: could not get root inode\n");
                return -ENOMEM;