.. | .. |
---|
33 | 33 | #include <linux/sysfs.h> |
---|
34 | 34 | #include <linux/debugfs.h> |
---|
35 | 35 | #include <linux/cpuhotplug.h> |
---|
| 36 | +#include <linux/part_stat.h> |
---|
36 | 37 | |
---|
37 | 38 | #include "zram_drv.h" |
---|
38 | 39 | |
---|
.. | .. |
---|
41 | 42 | static DEFINE_MUTEX(zram_index_mutex); |
---|
42 | 43 | |
---|
43 | 44 | static int zram_major; |
---|
44 | | -static const char *default_compressor = "lzo"; |
---|
| 45 | +static const char *default_compressor = "lzo-rle"; |
---|
45 | 46 | |
---|
46 | 47 | /* Module params (documentation at end) */ |
---|
47 | 48 | static unsigned int num_devices = 1; |
---|
.. | .. |
---|
50 | 51 | * uncompressed in memory. |
---|
51 | 52 | */ |
---|
52 | 53 | static size_t huge_class_size; |
---|
| 54 | + |
---|
| 55 | +static const struct block_device_operations zram_devops; |
---|
| 56 | +static const struct block_device_operations zram_wb_devops; |
---|
53 | 57 | |
---|
54 | 58 | static void zram_free_page(struct zram *zram, size_t index); |
---|
55 | 59 | static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, |
---|
.. | .. |
---|
207 | 211 | |
---|
208 | 212 | static bool page_same_filled(void *ptr, unsigned long *element) |
---|
209 | 213 | { |
---|
210 | | - unsigned int pos; |
---|
211 | 214 | unsigned long *page; |
---|
212 | 215 | unsigned long val; |
---|
| 216 | + unsigned int pos, last_pos = PAGE_SIZE / sizeof(*page) - 1; |
---|
213 | 217 | |
---|
214 | 218 | page = (unsigned long *)ptr; |
---|
215 | 219 | val = page[0]; |
---|
216 | 220 | |
---|
217 | | - for (pos = 1; pos < PAGE_SIZE / sizeof(*page); pos++) { |
---|
| 221 | + if (val != page[last_pos]) |
---|
| 222 | + return false; |
---|
| 223 | + |
---|
| 224 | + for (pos = 1; pos < last_pos; pos++) { |
---|
218 | 225 | if (val != page[pos]) |
---|
219 | 226 | return false; |
---|
220 | 227 | } |
---|
.. | .. |
---|
290 | 297 | struct zram *zram = dev_to_zram(dev); |
---|
291 | 298 | unsigned long nr_pages = zram->disksize >> PAGE_SHIFT; |
---|
292 | 299 | int index; |
---|
293 | | - char mode_buf[8]; |
---|
294 | | - ssize_t sz; |
---|
295 | 300 | |
---|
296 | | - sz = strscpy(mode_buf, buf, sizeof(mode_buf)); |
---|
297 | | - if (sz <= 0) |
---|
298 | | - return -EINVAL; |
---|
299 | | - |
---|
300 | | - /* ignore trailing new line */ |
---|
301 | | - if (mode_buf[sz - 1] == '\n') |
---|
302 | | - mode_buf[sz - 1] = 0x00; |
---|
303 | | - |
---|
304 | | - if (strcmp(mode_buf, "all")) |
---|
| 301 | + if (!sysfs_streq(buf, "all")) |
---|
305 | 302 | return -EINVAL; |
---|
306 | 303 | |
---|
307 | 304 | down_read(&zram->init_lock); |
---|
.. | .. |
---|
414 | 411 | zram->backing_dev = NULL; |
---|
415 | 412 | zram->old_block_size = 0; |
---|
416 | 413 | zram->bdev = NULL; |
---|
417 | | - zram->disk->queue->backing_dev_info->capabilities |= |
---|
418 | | - BDI_CAP_SYNCHRONOUS_IO; |
---|
| 414 | + zram->disk->fops = &zram_devops; |
---|
419 | 415 | kvfree(zram->bitmap); |
---|
420 | 416 | zram->bitmap = NULL; |
---|
421 | 417 | } |
---|
.. | .. |
---|
481 | 477 | if (sz > 0 && file_name[sz - 1] == '\n') |
---|
482 | 478 | file_name[sz - 1] = 0x00; |
---|
483 | 479 | |
---|
484 | | - backing_dev = filp_open(file_name, O_RDWR|O_LARGEFILE, 0); |
---|
| 480 | + backing_dev = filp_open_block(file_name, O_RDWR|O_LARGEFILE, 0); |
---|
485 | 481 | if (IS_ERR(backing_dev)) { |
---|
486 | 482 | err = PTR_ERR(backing_dev); |
---|
487 | 483 | backing_dev = NULL; |
---|
.. | .. |
---|
497 | 493 | goto out; |
---|
498 | 494 | } |
---|
499 | 495 | |
---|
500 | | - bdev = bdgrab(I_BDEV(inode)); |
---|
501 | | - err = blkdev_get(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL, zram); |
---|
502 | | - if (err < 0) { |
---|
| 496 | + bdev = blkdev_get_by_dev(inode->i_rdev, |
---|
| 497 | + FMODE_READ | FMODE_WRITE | FMODE_EXCL, zram); |
---|
| 498 | + if (IS_ERR(bdev)) { |
---|
| 499 | + err = PTR_ERR(bdev); |
---|
503 | 500 | bdev = NULL; |
---|
504 | 501 | goto out; |
---|
505 | 502 | } |
---|
.. | .. |
---|
534 | 531 | * freely but in fact, IO is going on so finally could cause |
---|
535 | 532 | * use-after-free when the IO is really done. |
---|
536 | 533 | */ |
---|
537 | | - zram->disk->queue->backing_dev_info->capabilities &= |
---|
538 | | - ~BDI_CAP_SYNCHRONOUS_IO; |
---|
| 534 | + zram->disk->fops = &zram_wb_devops; |
---|
539 | 535 | up_write(&zram->init_lock); |
---|
540 | 536 | |
---|
541 | 537 | pr_info("setup backing device %s\n", file_name); |
---|
.. | .. |
---|
624 | 620 | return 1; |
---|
625 | 621 | } |
---|
626 | 622 | |
---|
| 623 | +#define PAGE_WB_SIG "page_index=" |
---|
| 624 | + |
---|
| 625 | +#define PAGE_WRITEBACK 0 |
---|
627 | 626 | #define HUGE_WRITEBACK 1 |
---|
628 | 627 | #define IDLE_WRITEBACK 2 |
---|
| 628 | + |
---|
629 | 629 | |
---|
630 | 630 | static ssize_t writeback_store(struct device *dev, |
---|
631 | 631 | struct device_attribute *attr, const char *buf, size_t len) |
---|
632 | 632 | { |
---|
633 | 633 | struct zram *zram = dev_to_zram(dev); |
---|
634 | 634 | unsigned long nr_pages = zram->disksize >> PAGE_SHIFT; |
---|
635 | | - unsigned long index; |
---|
| 635 | + unsigned long index = 0; |
---|
636 | 636 | struct bio bio; |
---|
637 | 637 | struct bio_vec bio_vec; |
---|
638 | 638 | struct page *page; |
---|
639 | | - ssize_t ret, sz; |
---|
640 | | - char mode_buf[8]; |
---|
641 | | - int mode = -1; |
---|
| 639 | + ssize_t ret = len; |
---|
| 640 | + int mode, err; |
---|
642 | 641 | unsigned long blk_idx = 0; |
---|
643 | 642 | |
---|
644 | | - sz = strscpy(mode_buf, buf, sizeof(mode_buf)); |
---|
645 | | - if (sz <= 0) |
---|
646 | | - return -EINVAL; |
---|
647 | | - |
---|
648 | | - /* ignore trailing newline */ |
---|
649 | | - if (mode_buf[sz - 1] == '\n') |
---|
650 | | - mode_buf[sz - 1] = 0x00; |
---|
651 | | - |
---|
652 | | - if (!strcmp(mode_buf, "idle")) |
---|
| 643 | + if (sysfs_streq(buf, "idle")) |
---|
653 | 644 | mode = IDLE_WRITEBACK; |
---|
654 | | - else if (!strcmp(mode_buf, "huge")) |
---|
| 645 | + else if (sysfs_streq(buf, "huge")) |
---|
655 | 646 | mode = HUGE_WRITEBACK; |
---|
| 647 | + else { |
---|
| 648 | + if (strncmp(buf, PAGE_WB_SIG, sizeof(PAGE_WB_SIG) - 1)) |
---|
| 649 | + return -EINVAL; |
---|
656 | 650 | |
---|
657 | | - if (mode == -1) |
---|
658 | | - return -EINVAL; |
---|
| 651 | + if (kstrtol(buf + sizeof(PAGE_WB_SIG) - 1, 10, &index) || |
---|
| 652 | + index >= nr_pages) |
---|
| 653 | + return -EINVAL; |
---|
| 654 | + |
---|
| 655 | + nr_pages = 1; |
---|
| 656 | + mode = PAGE_WRITEBACK; |
---|
| 657 | + } |
---|
659 | 658 | |
---|
660 | 659 | down_read(&zram->init_lock); |
---|
661 | 660 | if (!init_done(zram)) { |
---|
.. | .. |
---|
674 | 673 | goto release_init_lock; |
---|
675 | 674 | } |
---|
676 | 675 | |
---|
677 | | - for (index = 0; index < nr_pages; index++) { |
---|
| 676 | + for (; nr_pages != 0; index++, nr_pages--) { |
---|
678 | 677 | struct bio_vec bvec; |
---|
679 | 678 | |
---|
680 | 679 | bvec.bv_page = page; |
---|
.. | .. |
---|
739 | 738 | * XXX: A single page IO would be inefficient for write |
---|
740 | 739 | * but it would be not bad as starter. |
---|
741 | 740 | */ |
---|
742 | | - ret = submit_bio_wait(&bio); |
---|
743 | | - if (ret) { |
---|
| 741 | + err = submit_bio_wait(&bio); |
---|
| 742 | + if (err) { |
---|
744 | 743 | zram_slot_lock(zram, index); |
---|
745 | 744 | zram_clear_flag(zram, index, ZRAM_UNDER_WB); |
---|
746 | 745 | zram_clear_flag(zram, index, ZRAM_IDLE); |
---|
747 | 746 | zram_slot_unlock(zram, index); |
---|
| 747 | + /* |
---|
| 748 | + * Return last IO error unless every IO were |
---|
| 749 | + * not suceeded. |
---|
| 750 | + */ |
---|
| 751 | + ret = err; |
---|
748 | 752 | continue; |
---|
749 | 753 | } |
---|
750 | 754 | |
---|
.. | .. |
---|
782 | 786 | |
---|
783 | 787 | if (blk_idx) |
---|
784 | 788 | free_block_bdev(zram, blk_idx); |
---|
785 | | - ret = len; |
---|
786 | 789 | __free_page(page); |
---|
787 | 790 | release_init_lock: |
---|
788 | 791 | up_read(&zram->init_lock); |
---|
.. | .. |
---|
810 | 813 | } |
---|
811 | 814 | |
---|
812 | 815 | /* |
---|
813 | | - * Block layer want one ->make_request_fn to be active at a time |
---|
814 | | - * so if we use chained IO with parent IO in same context, |
---|
815 | | - * it's a deadlock. To avoid, it, it uses worker thread context. |
---|
| 816 | + * Block layer want one ->submit_bio to be active at a time, so if we use |
---|
| 817 | + * chained IO with parent IO in same context, it's a deadlock. To avoid that, |
---|
| 818 | + * use a worker thread context. |
---|
816 | 819 | */ |
---|
817 | 820 | static int read_from_bdev_sync(struct zram *zram, struct bio_vec *bvec, |
---|
818 | 821 | unsigned long entry, struct bio *bio) |
---|
.. | .. |
---|
1233 | 1236 | static int __zram_bvec_read(struct zram *zram, struct page *page, u32 index, |
---|
1234 | 1237 | struct bio *bio, bool partial_io) |
---|
1235 | 1238 | { |
---|
1236 | | - int ret; |
---|
| 1239 | + struct zcomp_strm *zstrm; |
---|
1237 | 1240 | unsigned long handle; |
---|
1238 | 1241 | unsigned int size; |
---|
1239 | 1242 | void *src, *dst; |
---|
| 1243 | + int ret; |
---|
1240 | 1244 | |
---|
1241 | 1245 | zram_slot_lock(zram, index); |
---|
1242 | 1246 | if (zram_test_flag(zram, index, ZRAM_WB)) { |
---|
.. | .. |
---|
1267 | 1271 | |
---|
1268 | 1272 | size = zram_get_obj_size(zram, index); |
---|
1269 | 1273 | |
---|
| 1274 | + if (size != PAGE_SIZE) |
---|
| 1275 | + zstrm = zcomp_stream_get(zram->comp); |
---|
| 1276 | + |
---|
1270 | 1277 | src = zs_map_object(zram->mem_pool, handle, ZS_MM_RO); |
---|
1271 | 1278 | if (size == PAGE_SIZE) { |
---|
1272 | 1279 | dst = kmap_atomic(page); |
---|
.. | .. |
---|
1274 | 1281 | kunmap_atomic(dst); |
---|
1275 | 1282 | ret = 0; |
---|
1276 | 1283 | } else { |
---|
1277 | | - struct zcomp_strm *zstrm = zcomp_stream_get(zram->comp); |
---|
1278 | | - |
---|
1279 | 1284 | dst = kmap_atomic(page); |
---|
1280 | 1285 | ret = zcomp_decompress(zstrm, src, size, dst); |
---|
1281 | 1286 | kunmap_atomic(dst); |
---|
.. | .. |
---|
1285 | 1290 | zram_slot_unlock(zram, index); |
---|
1286 | 1291 | |
---|
1287 | 1292 | /* Should NEVER happen. Return bio error if it does. */ |
---|
1288 | | - if (unlikely(ret)) |
---|
| 1293 | + if (WARN_ON(ret)) |
---|
1289 | 1294 | pr_err("Decompression failed! err=%d, page=%u\n", ret, index); |
---|
1290 | 1295 | |
---|
1291 | 1296 | return ret; |
---|
.. | .. |
---|
1380 | 1385 | __GFP_KSWAPD_RECLAIM | |
---|
1381 | 1386 | __GFP_NOWARN | |
---|
1382 | 1387 | __GFP_HIGHMEM | |
---|
1383 | | - __GFP_MOVABLE); |
---|
| 1388 | + __GFP_MOVABLE | |
---|
| 1389 | + __GFP_CMA); |
---|
1384 | 1390 | if (!handle) { |
---|
1385 | 1391 | zcomp_stream_put(zram->comp); |
---|
1386 | 1392 | atomic64_inc(&zram->stats.writestall); |
---|
1387 | 1393 | handle = zs_malloc(zram->mem_pool, comp_len, |
---|
1388 | 1394 | GFP_NOIO | __GFP_HIGHMEM | |
---|
1389 | | - __GFP_MOVABLE); |
---|
| 1395 | + __GFP_MOVABLE | __GFP_CMA); |
---|
1390 | 1396 | if (handle) |
---|
1391 | 1397 | goto compress_again; |
---|
1392 | 1398 | return -ENOMEM; |
---|
.. | .. |
---|
1527 | 1533 | static int zram_bvec_rw(struct zram *zram, struct bio_vec *bvec, u32 index, |
---|
1528 | 1534 | int offset, unsigned int op, struct bio *bio) |
---|
1529 | 1535 | { |
---|
1530 | | - unsigned long start_time = jiffies; |
---|
1531 | | - struct request_queue *q = zram->disk->queue; |
---|
1532 | 1536 | int ret; |
---|
1533 | | - |
---|
1534 | | - generic_start_io_acct(q, op, bvec->bv_len >> SECTOR_SHIFT, |
---|
1535 | | - &zram->disk->part0); |
---|
1536 | 1537 | |
---|
1537 | 1538 | if (!op_is_write(op)) { |
---|
1538 | 1539 | atomic64_inc(&zram->stats.num_reads); |
---|
.. | .. |
---|
1542 | 1543 | atomic64_inc(&zram->stats.num_writes); |
---|
1543 | 1544 | ret = zram_bvec_write(zram, bvec, index, offset, bio); |
---|
1544 | 1545 | } |
---|
1545 | | - |
---|
1546 | | - generic_end_io_acct(q, op, &zram->disk->part0, start_time); |
---|
1547 | 1546 | |
---|
1548 | 1547 | zram_slot_lock(zram, index); |
---|
1549 | 1548 | zram_accessed(zram, index); |
---|
.. | .. |
---|
1565 | 1564 | u32 index; |
---|
1566 | 1565 | struct bio_vec bvec; |
---|
1567 | 1566 | struct bvec_iter iter; |
---|
| 1567 | + unsigned long start_time; |
---|
1568 | 1568 | |
---|
1569 | 1569 | index = bio->bi_iter.bi_sector >> SECTORS_PER_PAGE_SHIFT; |
---|
1570 | 1570 | offset = (bio->bi_iter.bi_sector & |
---|
.. | .. |
---|
1580 | 1580 | break; |
---|
1581 | 1581 | } |
---|
1582 | 1582 | |
---|
| 1583 | + start_time = bio_start_io_acct(bio); |
---|
1583 | 1584 | bio_for_each_segment(bvec, bio, iter) { |
---|
1584 | 1585 | struct bio_vec bv = bvec; |
---|
1585 | 1586 | unsigned int unwritten = bvec.bv_len; |
---|
.. | .. |
---|
1588 | 1589 | bv.bv_len = min_t(unsigned int, PAGE_SIZE - offset, |
---|
1589 | 1590 | unwritten); |
---|
1590 | 1591 | if (zram_bvec_rw(zram, &bv, index, offset, |
---|
1591 | | - bio_op(bio), bio) < 0) |
---|
1592 | | - goto out; |
---|
| 1592 | + bio_op(bio), bio) < 0) { |
---|
| 1593 | + bio->bi_status = BLK_STS_IOERR; |
---|
| 1594 | + break; |
---|
| 1595 | + } |
---|
1593 | 1596 | |
---|
1594 | 1597 | bv.bv_offset += bv.bv_len; |
---|
1595 | 1598 | unwritten -= bv.bv_len; |
---|
.. | .. |
---|
1597 | 1600 | update_position(&index, &offset, &bv); |
---|
1598 | 1601 | } while (unwritten); |
---|
1599 | 1602 | } |
---|
1600 | | - |
---|
| 1603 | + bio_end_io_acct(bio, start_time); |
---|
1601 | 1604 | bio_endio(bio); |
---|
1602 | | - return; |
---|
1603 | | - |
---|
1604 | | -out: |
---|
1605 | | - bio_io_error(bio); |
---|
1606 | 1605 | } |
---|
1607 | 1606 | |
---|
1608 | 1607 | /* |
---|
1609 | 1608 | * Handler function for all zram I/O requests. |
---|
1610 | 1609 | */ |
---|
1611 | | -static blk_qc_t zram_make_request(struct request_queue *queue, struct bio *bio) |
---|
| 1610 | +static blk_qc_t zram_submit_bio(struct bio *bio) |
---|
1612 | 1611 | { |
---|
1613 | | - struct zram *zram = queue->queuedata; |
---|
| 1612 | + struct zram *zram = bio->bi_disk->private_data; |
---|
1614 | 1613 | |
---|
1615 | 1614 | if (!valid_io_request(zram, bio->bi_iter.bi_sector, |
---|
1616 | 1615 | bio->bi_iter.bi_size)) { |
---|
.. | .. |
---|
1650 | 1649 | u32 index; |
---|
1651 | 1650 | struct zram *zram; |
---|
1652 | 1651 | struct bio_vec bv; |
---|
| 1652 | + unsigned long start_time; |
---|
1653 | 1653 | |
---|
1654 | 1654 | if (PageTransHuge(page)) |
---|
1655 | 1655 | return -ENOTSUPP; |
---|
.. | .. |
---|
1668 | 1668 | bv.bv_len = PAGE_SIZE; |
---|
1669 | 1669 | bv.bv_offset = 0; |
---|
1670 | 1670 | |
---|
| 1671 | + start_time = disk_start_io_acct(bdev->bd_disk, SECTORS_PER_PAGE, op); |
---|
1671 | 1672 | ret = zram_bvec_rw(zram, &bv, index, offset, op, NULL); |
---|
| 1673 | + disk_end_io_acct(bdev->bd_disk, op, start_time); |
---|
1672 | 1674 | out: |
---|
1673 | 1675 | /* |
---|
1674 | 1676 | * If I/O fails, just return error(ie, non-zero) without |
---|
.. | .. |
---|
1760 | 1762 | zram->disksize = disksize; |
---|
1761 | 1763 | set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT); |
---|
1762 | 1764 | |
---|
1763 | | - revalidate_disk(zram->disk); |
---|
| 1765 | + revalidate_disk_size(zram->disk, true); |
---|
1764 | 1766 | up_write(&zram->init_lock); |
---|
1765 | 1767 | |
---|
1766 | 1768 | return len; |
---|
.. | .. |
---|
1807 | 1809 | /* Make sure all the pending I/O are finished */ |
---|
1808 | 1810 | fsync_bdev(bdev); |
---|
1809 | 1811 | zram_reset_device(zram); |
---|
1810 | | - revalidate_disk(zram->disk); |
---|
| 1812 | + revalidate_disk_size(zram->disk, true); |
---|
1811 | 1813 | bdput(bdev); |
---|
1812 | 1814 | |
---|
1813 | 1815 | mutex_lock(&bdev->bd_mutex); |
---|
.. | .. |
---|
1834 | 1836 | |
---|
1835 | 1837 | static const struct block_device_operations zram_devops = { |
---|
1836 | 1838 | .open = zram_open, |
---|
| 1839 | + .submit_bio = zram_submit_bio, |
---|
1837 | 1840 | .swap_slot_free_notify = zram_slot_free_notify, |
---|
1838 | 1841 | .rw_page = zram_rw_page, |
---|
| 1842 | + .owner = THIS_MODULE |
---|
| 1843 | +}; |
---|
| 1844 | + |
---|
| 1845 | +static const struct block_device_operations zram_wb_devops = { |
---|
| 1846 | + .open = zram_open, |
---|
| 1847 | + .submit_bio = zram_submit_bio, |
---|
| 1848 | + .swap_slot_free_notify = zram_slot_free_notify, |
---|
1839 | 1849 | .owner = THIS_MODULE |
---|
1840 | 1850 | }; |
---|
1841 | 1851 | |
---|
.. | .. |
---|
1912 | 1922 | #ifdef CONFIG_ZRAM_WRITEBACK |
---|
1913 | 1923 | spin_lock_init(&zram->wb_limit_lock); |
---|
1914 | 1924 | #endif |
---|
1915 | | - queue = blk_alloc_queue(GFP_KERNEL); |
---|
| 1925 | + queue = blk_alloc_queue(NUMA_NO_NODE); |
---|
1916 | 1926 | if (!queue) { |
---|
1917 | 1927 | pr_err("Error allocating disk queue for device %d\n", |
---|
1918 | 1928 | device_id); |
---|
1919 | 1929 | ret = -ENOMEM; |
---|
1920 | 1930 | goto out_free_idr; |
---|
1921 | 1931 | } |
---|
1922 | | - |
---|
1923 | | - blk_queue_make_request(queue, zram_make_request); |
---|
1924 | 1932 | |
---|
1925 | 1933 | /* gendisk structure */ |
---|
1926 | 1934 | zram->disk = alloc_disk(1); |
---|
.. | .. |
---|
1935 | 1943 | zram->disk->first_minor = device_id; |
---|
1936 | 1944 | zram->disk->fops = &zram_devops; |
---|
1937 | 1945 | zram->disk->queue = queue; |
---|
1938 | | - zram->disk->queue->queuedata = zram; |
---|
1939 | 1946 | zram->disk->private_data = zram; |
---|
1940 | 1947 | snprintf(zram->disk->disk_name, 16, "zram%d", device_id); |
---|
1941 | 1948 | |
---|
.. | .. |
---|
1969 | 1976 | if (ZRAM_LOGICAL_BLOCK_SIZE == PAGE_SIZE) |
---|
1970 | 1977 | blk_queue_max_write_zeroes_sectors(zram->disk->queue, UINT_MAX); |
---|
1971 | 1978 | |
---|
1972 | | - zram->disk->queue->backing_dev_info->capabilities |= |
---|
1973 | | - (BDI_CAP_STABLE_WRITES | BDI_CAP_SYNCHRONOUS_IO); |
---|
1974 | | - disk_to_dev(zram->disk)->groups = zram_disk_attr_groups; |
---|
1975 | | - add_disk(zram->disk); |
---|
| 1979 | + blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, zram->disk->queue); |
---|
| 1980 | + device_add_disk(NULL, zram->disk, zram_disk_attr_groups); |
---|
1976 | 1981 | |
---|
1977 | 1982 | strlcpy(zram->compressor, default_compressor, sizeof(zram->compressor)); |
---|
1978 | 1983 | |
---|
.. | .. |
---|
2008 | 2013 | mutex_unlock(&bdev->bd_mutex); |
---|
2009 | 2014 | |
---|
2010 | 2015 | zram_debugfs_unregister(zram); |
---|
| 2016 | + |
---|
2011 | 2017 | /* Make sure all the pending I/O are finished */ |
---|
2012 | 2018 | fsync_bdev(bdev); |
---|
2013 | 2019 | zram_reset_device(zram); |
---|