X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fufs%2Fsuper.c;h=73402c5eeb8afc90452768b57f0cbdb13fcc3469;hb=d9ff963801e4f7648c55a27413a1b1de59480a30;hp=be7c48c5f203f11c7c0a079ae1628a89ea7fdfa4;hpb=334d0dd8b660557608142f0f77abc6812b48f08b;p=linux-2.6 diff --git a/fs/ufs/super.c b/fs/ufs/super.c index be7c48c5f2..73402c5eeb 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c @@ -87,6 +87,7 @@ #include #include #include +#include #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; @@ -1237,17 +1238,16 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag { struct ufs_inode_info *ei = (struct ufs_inode_info *) foo; - if (flags & SLAB_CTOR_CONSTRUCTOR) - inode_init_once(&ei->vfs_inode); + 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;