diff --git a/mm/swapfile.c b/mm/swapfile.c index 261f6e24..f567dd49 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -1889,17 +1889,8 @@ static struct swap_info_struct *alloc_swap_info(void) static int claim_swapfile(struct swap_info_struct *p, struct inode *inode) { int error; - /* On Chromium OS, we only support zram swap devices. */ if (S_ISBLK(inode->i_mode)) { - char name[BDEVNAME_SIZE]; p->bdev = bdgrab(I_BDEV(inode)); - bdevname(p->bdev, name); - if (strncmp(name, "zram", strlen("zram")) && - strncmp(name, "ram", strlen("ram"))) { - bdput(p->bdev); - p->bdev = NULL; - return -EINVAL; - } error = blkdev_get(p->bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL, sys_swapon); @@ -1912,13 +1903,11 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode) if (error < 0) return error; p->flags |= SWP_BLKDEV; -#if 0 } else if (S_ISREG(inode->i_mode)) { p->bdev = inode->i_sb->s_bdev; mutex_lock(&inode->i_mutex); if (IS_SWAPFILE(inode)) return -EBUSY; -#endif } else return -EINVAL;