diff options
Diffstat (limited to 'fs/xfs/xfs_buf.c')
| -rw-r--r-- | fs/xfs/xfs_buf.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 4db6e8d780f6..4c6e86d861fd 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c | |||
| @@ -1815,22 +1815,27 @@ xfs_alloc_buftarg( | |||
| 1815 | btp->bt_daxdev = dax_dev; | 1815 | btp->bt_daxdev = dax_dev; |
| 1816 | 1816 | ||
| 1817 | if (xfs_setsize_buftarg_early(btp, bdev)) | 1817 | if (xfs_setsize_buftarg_early(btp, bdev)) |
| 1818 | goto error; | 1818 | goto error_free; |
| 1819 | 1819 | ||
| 1820 | if (list_lru_init(&btp->bt_lru)) | 1820 | if (list_lru_init(&btp->bt_lru)) |
| 1821 | goto error; | 1821 | goto error_free; |
| 1822 | 1822 | ||
| 1823 | if (percpu_counter_init(&btp->bt_io_count, 0, GFP_KERNEL)) | 1823 | if (percpu_counter_init(&btp->bt_io_count, 0, GFP_KERNEL)) |
| 1824 | goto error; | 1824 | goto error_lru; |
| 1825 | 1825 | ||
| 1826 | btp->bt_shrinker.count_objects = xfs_buftarg_shrink_count; | 1826 | btp->bt_shrinker.count_objects = xfs_buftarg_shrink_count; |
| 1827 | btp->bt_shrinker.scan_objects = xfs_buftarg_shrink_scan; | 1827 | btp->bt_shrinker.scan_objects = xfs_buftarg_shrink_scan; |
| 1828 | btp->bt_shrinker.seeks = DEFAULT_SEEKS; | 1828 | btp->bt_shrinker.seeks = DEFAULT_SEEKS; |
| 1829 | btp->bt_shrinker.flags = SHRINKER_NUMA_AWARE; | 1829 | btp->bt_shrinker.flags = SHRINKER_NUMA_AWARE; |
| 1830 | register_shrinker(&btp->bt_shrinker); | 1830 | if (register_shrinker(&btp->bt_shrinker)) |
| 1831 | goto error_pcpu; | ||
| 1831 | return btp; | 1832 | return btp; |
| 1832 | 1833 | ||
| 1833 | error: | 1834 | error_pcpu: |
| 1835 | percpu_counter_destroy(&btp->bt_io_count); | ||
| 1836 | error_lru: | ||
| 1837 | list_lru_destroy(&btp->bt_lru); | ||
| 1838 | error_free: | ||
| 1834 | kmem_free(btp); | 1839 | kmem_free(btp); |
| 1835 | return NULL; | 1840 | return NULL; |
| 1836 | } | 1841 | } |
