[PATCH] slab: remove SLAB_KERNEL
[powerpc.git] / fs / befs / linuxvfs.c
index fcaeead..995348d 100644 (file)
@@ -22,7 +22,6 @@
 #include "datastream.h"
 #include "super.h"
 #include "io.h"
-#include "endian.h"
 
 MODULE_DESCRIPTION("BeOS File System (BeFS) driver");
 MODULE_AUTHOR("Will Dyson");
@@ -278,7 +277,7 @@ befs_alloc_inode(struct super_block *sb)
 {
         struct befs_inode_info *bi;
         bi = (struct befs_inode_info *)kmem_cache_alloc(befs_inode_cachep,
-                                                       SLAB_KERNEL);
+                                                       GFP_KERNEL);
         if (!bi)
                 return NULL;
         return &bi->vfs_inode;
@@ -365,7 +364,6 @@ befs_read_inode(struct inode *inode)
        inode->i_mtime.tv_nsec = 0;   /* lower 16 bits are not a time */        
        inode->i_ctime = inode->i_mtime;
        inode->i_atime = inode->i_mtime;
-       inode->i_blksize = befs_sb->block_size;
 
        befs_ino->i_inode_num = fsrun_to_cpu(sb, raw_inode->inode_num);
        befs_ino->i_parent = fsrun_to_cpu(sb, raw_inode->parent);
@@ -446,9 +444,7 @@ befs_init_inodecache(void)
 static void
 befs_destroy_inodecache(void)
 {
-       if (kmem_cache_destroy(befs_inode_cachep))
-               printk(KERN_ERR "befs_destroy_inodecache: "
-                      "not all structures were freed\n");
+       kmem_cache_destroy(befs_inode_cachep);
 }
 
 /*
@@ -512,7 +508,11 @@ befs_utf2nls(struct super_block *sb, const char *in,
        wchar_t uni;
        int unilen, utflen;
        char *result;
-       int maxlen = in_len; /* The utf8->nls conversion can't make more chars */
+       /* The utf8->nls conversion won't make the final nls string bigger
+        * than the utf one, but if the string is pure ascii they'll have the
+        * same width and an extra char is needed to save the additional \0
+        */
+       int maxlen = in_len + 1;
 
        befs_debug(sb, "---> utf2nls()");
 
@@ -588,7 +588,10 @@ befs_nls2utf(struct super_block *sb, const char *in,
        wchar_t uni;
        int unilen, utflen;
        char *result;
-       int maxlen = 3 * in_len;
+       /* There're nls characters that will translate to 3-chars-wide UTF-8
+        * characters, a additional byte is needed to save the final \0
+        * in special cases */
+       int maxlen = (3 * in_len) + 1;
 
        befs_debug(sb, "---> nls2utf()\n");