[PATCH] ncpfs: remove kmalloc wrapper
authorPekka Enberg <penberg@cs.helsinki.fi>
Sat, 14 Jan 2006 21:21:12 +0000 (13:21 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 15 Jan 2006 02:27:12 +0000 (18:27 -0800)
Remove remaining kmalloc wrapper bits from fs/ncpfs/.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/ncpfs/inode.c
fs/ncpfs/ioctl.c
include/linux/ncp_fs.h

index 8c8839203cd5a0bae7e0e4cb0fec352748b02391..d277a58bd128c34926eb7f21c492c621333b770e 100644 (file)
@@ -716,10 +716,8 @@ static void ncp_put_super(struct super_block *sb)
        fput(server->ncp_filp);
        kill_proc(server->m.wdog_pid, SIGTERM, 1);
 
-       if (server->priv.data) 
-               ncp_kfree_s(server->priv.data, server->priv.len);
-       if (server->auth.object_name)
-               ncp_kfree_s(server->auth.object_name, server->auth.object_name_len);
+       kfree(server->priv.data);
+       kfree(server->auth.object_name);
        vfree(server->packet);
        sb->s_fs_info = NULL;
        kfree(server);
@@ -958,11 +956,6 @@ out:
        return result;
 }
 
-#ifdef DEBUG_NCP_MALLOC
-int ncp_malloced;
-int ncp_current_malloced;
-#endif
-
 static struct super_block *ncp_get_sb(struct file_system_type *fs_type,
        int flags, const char *dev_name, void *data)
 {
@@ -981,10 +974,6 @@ static int __init init_ncp_fs(void)
        int err;
        DPRINTK("ncpfs: init_module called\n");
 
-#ifdef DEBUG_NCP_MALLOC
-       ncp_malloced = 0;
-       ncp_current_malloced = 0;
-#endif
        err = init_inodecache();
        if (err)
                goto out1;
@@ -1003,10 +992,6 @@ static void __exit exit_ncp_fs(void)
        DPRINTK("ncpfs: cleanup_module called\n");
        unregister_filesystem(&ncp_fs_type);
        destroy_inodecache();
-#ifdef DEBUG_NCP_MALLOC
-       PRINTK("ncp_malloced: %d\n", ncp_malloced);
-       PRINTK("ncp_current_malloced: %d\n", ncp_current_malloced);
-#endif
 }
 
 module_init(init_ncp_fs)
index d6e0c089e1b110830b0e596160867f4c3bd93856..eb3813ad136f192e5c0a7551eefc8cd417d09fb3 100644 (file)
@@ -518,10 +518,11 @@ outrel:
                        if (user.object_name_len > NCP_OBJECT_NAME_MAX_LEN)
                                return -ENOMEM;
                        if (user.object_name_len) {
-                               newname = ncp_kmalloc(user.object_name_len, GFP_USER);
-                               if (!newname) return -ENOMEM;
+                               newname = kmalloc(user.object_name_len, GFP_USER);
+                               if (!newname)
+                                       return -ENOMEM;
                                if (copy_from_user(newname, user.object_name, user.object_name_len)) {
-                                       ncp_kfree_s(newname, user.object_name_len);
+                                       kfree(newname);
                                        return -EFAULT;
                                }
                        } else {
@@ -540,8 +541,8 @@ outrel:
                        server->priv.len = 0;
                        server->priv.data = NULL;
                        /* leave critical section */
-                       if (oldprivate) ncp_kfree_s(oldprivate, oldprivatelen);
-                       if (oldname) ncp_kfree_s(oldname, oldnamelen);
+                       kfree(oldprivate);
+                       kfree(oldname);
                        return 0;
                }
        case NCP_IOC_GETPRIVATEDATA:
@@ -581,10 +582,11 @@ outrel:
                        if (user.len > NCP_PRIVATE_DATA_MAX_LEN)
                                return -ENOMEM;
                        if (user.len) {
-                               new = ncp_kmalloc(user.len, GFP_USER);
-                               if (!new) return -ENOMEM;
+                               new = kmalloc(user.len, GFP_USER);
+                               if (!new)
+                                       return -ENOMEM;
                                if (copy_from_user(new, user.data, user.len)) {
-                                       ncp_kfree_s(new, user.len);
+                                       kfree(new);
                                        return -EFAULT;
                                }
                        } else {
@@ -596,7 +598,7 @@ outrel:
                        server->priv.len = user.len;
                        server->priv.data = new;
                        /* leave critical section */
-                       if (old) ncp_kfree_s(old, oldlen);
+                       kfree(old);
                        return 0;
                }
 
index 7297e4372c0fdfc5452ef6d52c38e243a4419771..e013425685302654e31021c870e4777184ee07a7 100644 (file)
@@ -201,34 +201,6 @@ static inline struct ncp_inode_info *NCP_FINFO(struct inode *inode)
        return container_of(inode, struct ncp_inode_info, vfs_inode);
 }
 
-#ifdef DEBUG_NCP_MALLOC
-
-#include <linux/slab.h>
-
-extern int ncp_malloced;
-extern int ncp_current_malloced;
-
-static inline void *
- ncp_kmalloc(unsigned int size, int priority)
-{
-       ncp_malloced += 1;
-       ncp_current_malloced += 1;
-       return kmalloc(size, priority);
-}
-
-static inline void ncp_kfree_s(void *obj, int size)
-{
-       ncp_current_malloced -= 1;
-       kfree(obj);
-}
-
-#else                          /* DEBUG_NCP_MALLOC */
-
-#define ncp_kmalloc(s,p) kmalloc(s,p)
-#define ncp_kfree_s(o,s) kfree(o)
-
-#endif                         /* DEBUG_NCP_MALLOC */
-
 /* linux/fs/ncpfs/inode.c */
 int ncp_notify_change(struct dentry *, struct iattr *);
 struct inode *ncp_iget(struct super_block *, struct ncp_entry_info *);