15 #include <linux/device.h>
39 if (disk_to_dev(zram->
disk) ==
dev)
49 struct zram *zram = dev_to_zram(dev);
59 struct zram *zram = dev_to_zram(dev);
68 pr_info(
"Cannot change disksize for initialized device\n");
82 struct zram *zram = dev_to_zram(dev);
95 zram = dev_to_zram(dev);
124 struct zram *zram = dev_to_zram(dev);
127 zram_stat64_read(zram, &zram->
stats.num_reads));
133 struct zram *zram = dev_to_zram(dev);
136 zram_stat64_read(zram, &zram->
stats.num_writes));
142 struct zram *zram = dev_to_zram(dev);
145 zram_stat64_read(zram, &zram->
stats.invalid_io));
151 struct zram *zram = dev_to_zram(dev);
154 zram_stat64_read(zram, &zram->
stats.notify_free));
160 struct zram *zram = dev_to_zram(dev);
168 struct zram *zram = dev_to_zram(dev);
177 struct zram *zram = dev_to_zram(dev);
180 zram_stat64_read(zram, &zram->
stats.compr_size));
187 struct zram *zram = dev_to_zram(dev);
192 return sprintf(buf,
"%llu\n", val);
196 disksize_show, disksize_store);
208 static struct attribute *zram_disk_attrs[] = {
209 &dev_attr_disksize.attr,
210 &dev_attr_initstate.attr,
211 &dev_attr_reset.attr,
212 &dev_attr_num_reads.attr,
213 &dev_attr_num_writes.attr,
214 &dev_attr_invalid_io.attr,
215 &dev_attr_notify_free.attr,
216 &dev_attr_zero_pages.attr,
217 &dev_attr_orig_data_size.attr,
218 &dev_attr_compr_data_size.attr,
219 &dev_attr_mem_used_total.attr,
224 .attrs = zram_disk_attrs,