]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ufs/super.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[linux-2.6-omap-h63xx.git] / fs / ufs / super.c
index 22ff6ed55ce9a2d685024bfadf3aabb1eed68fa5..38eb0b7a1f3d3111c0e4a1b604d7ac40e110cc46 100644 (file)
@@ -87,6 +87,7 @@
 #include <linux/smp_lock.h>
 #include <linux/buffer_head.h>
 #include <linux/vfs.h>
+#include <linux/log2.h>
 
 #include "swab.h"
 #include "util.h"
@@ -854,7 +855,7 @@ magic_found:
        uspi->s_fmask = fs32_to_cpu(sb, usb1->fs_fmask);
        uspi->s_fshift = fs32_to_cpu(sb, usb1->fs_fshift);
 
-       if (uspi->s_fsize & (uspi->s_fsize - 1)) {
+       if (!is_power_of_2(uspi->s_fsize)) {
                printk(KERN_ERR "ufs_read_super: fragment size %u is not a power of 2\n",
                        uspi->s_fsize);
                        goto failed;
@@ -869,7 +870,7 @@ magic_found:
                        uspi->s_fsize);
                goto failed;
        }
-       if (uspi->s_bsize & (uspi->s_bsize - 1)) {
+       if (!is_power_of_2(uspi->s_bsize)) {
                printk(KERN_ERR "ufs_read_super: block size %u is not a power of 2\n",
                        uspi->s_bsize);
                goto failed;
@@ -893,7 +894,7 @@ magic_found:
                goto again;
        }
 
-
+       sbi->s_flags = flags;/*after that line some functions use s_flags*/
        ufs_print_super_stuff(sb, usb1, usb2, usb3);
 
        /*
@@ -1024,8 +1025,6 @@ magic_found:
            UFS_MOUNT_UFSTYPE_44BSD)
                uspi->s_maxsymlinklen =
                    fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen);
-       
-       sbi->s_flags = flags;
 
        inode = iget(sb, UFS_ROOTINO);
        if (!inode || is_bad_inode(inode))
@@ -1239,14 +1238,14 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
 
        inode_init_once(&ei->vfs_inode);
 }
+
 static int init_inodecache(void)
 {
        ufs_inode_cachep = kmem_cache_create("ufs_inode_cache",
                                             sizeof(struct ufs_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
                                                SLAB_MEM_SPREAD),
-                                            init_once, NULL);
+                                            init_once);
        if (ufs_inode_cachep == NULL)
                return -ENOMEM;
        return 0;