diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-29 19:38:48 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-29 19:38:48 -0400 |
| commit | a7ca10f263d7e673c74d8e0946d6b9993405cc9c (patch) | |
| tree | 7c50f0e728ca1a426235356acba1115c45dfe809 /drivers/block | |
| parent | d506aa68c23db708ad45ca8c17f0d7f5d7029a37 (diff) | |
| parent | 4d88e6f7d5ffc84e6094a47925870f4a130555c2 (diff) | |
Merge branch 'akpm' (incoming from Andrew Morton)
Merge misc fixes from Andrew Morton:
"21 fixes"
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (21 commits)
mm/balloon_compaction: fix deflation when compaction is disabled
sh: fix sh770x SCIF memory regions
zram: avoid NULL pointer access in concurrent situation
mm/slab_common: don't check for duplicate cache names
ocfs2: fix d_splice_alias() return code checking
mm: rmap: split out page_remove_file_rmap()
mm: memcontrol: fix missed end-writeback page accounting
mm: page-writeback: inline account_page_dirtied() into single caller
lib/bitmap.c: fix undefined shift in __bitmap_shift_{left|right}()
drivers/rtc/rtc-bq32k.c: fix register value
memory-hotplug: clear pgdat which is allocated by bootmem in try_offline_node()
drivers/rtc/rtc-s3c.c: fix initialization failure without rtc source clock
kernel/kmod: fix use-after-free of the sub_info structure
drivers/rtc/rtc-pm8xxx.c: rework to support pm8941 rtc
mm, thp: fix collapsing of hugepages on madvise
drivers: of: add return value to of_reserved_mem_device_init()
mm: free compound page with correct order
gcov: add ARM64 to GCOV_PROFILE_ALL
fsnotify: next_i is freed during fsnotify_unmount_inodes.
mm/compaction.c: avoid premature range skip in isolate_migratepages_range
...
Diffstat (limited to 'drivers/block')
| -rw-r--r-- | drivers/block/zram/zram_drv.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 0e63e8aa8279..2ad0b5bce44b 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c | |||
| @@ -99,11 +99,12 @@ static ssize_t mem_used_total_show(struct device *dev, | |||
| 99 | { | 99 | { |
| 100 | u64 val = 0; | 100 | u64 val = 0; |
| 101 | struct zram *zram = dev_to_zram(dev); | 101 | struct zram *zram = dev_to_zram(dev); |
| 102 | struct zram_meta *meta = zram->meta; | ||
| 103 | 102 | ||
| 104 | down_read(&zram->init_lock); | 103 | down_read(&zram->init_lock); |
| 105 | if (init_done(zram)) | 104 | if (init_done(zram)) { |
| 105 | struct zram_meta *meta = zram->meta; | ||
| 106 | val = zs_get_total_pages(meta->mem_pool); | 106 | val = zs_get_total_pages(meta->mem_pool); |
| 107 | } | ||
| 107 | up_read(&zram->init_lock); | 108 | up_read(&zram->init_lock); |
| 108 | 109 | ||
| 109 | return scnprintf(buf, PAGE_SIZE, "%llu\n", val << PAGE_SHIFT); | 110 | return scnprintf(buf, PAGE_SIZE, "%llu\n", val << PAGE_SHIFT); |
| @@ -173,16 +174,17 @@ static ssize_t mem_used_max_store(struct device *dev, | |||
| 173 | int err; | 174 | int err; |
| 174 | unsigned long val; | 175 | unsigned long val; |
| 175 | struct zram *zram = dev_to_zram(dev); | 176 | struct zram *zram = dev_to_zram(dev); |
| 176 | struct zram_meta *meta = zram->meta; | ||
| 177 | 177 | ||
| 178 | err = kstrtoul(buf, 10, &val); | 178 | err = kstrtoul(buf, 10, &val); |
| 179 | if (err || val != 0) | 179 | if (err || val != 0) |
| 180 | return -EINVAL; | 180 | return -EINVAL; |
| 181 | 181 | ||
| 182 | down_read(&zram->init_lock); | 182 | down_read(&zram->init_lock); |
| 183 | if (init_done(zram)) | 183 | if (init_done(zram)) { |
| 184 | struct zram_meta *meta = zram->meta; | ||
| 184 | atomic_long_set(&zram->stats.max_used_pages, | 185 | atomic_long_set(&zram->stats.max_used_pages, |
| 185 | zs_get_total_pages(meta->mem_pool)); | 186 | zs_get_total_pages(meta->mem_pool)); |
| 187 | } | ||
| 186 | up_read(&zram->init_lock); | 188 | up_read(&zram->init_lock); |
| 187 | 189 | ||
| 188 | return len; | 190 | return len; |
