aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/umem.c
diff options
context:
space:
mode:
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>2014-04-07 15:38:24 -0700
committerSimon Shields <keepcalm444@gmail.com>2016-06-12 21:20:05 +1000
commite1a61f0e687dbaa5106b2df60daf3c7f52d2c9c8 (patch)
tree5ea043115a819b59aaf3ee0327be4d561b93bc64 /drivers/block/umem.c
parent35f7bb02007e0de1e3e6fdf3b14ce5f5ccee32db (diff)
downloadkernel_samsung_smdk4412-e1a61f0e687dbaa5106b2df60daf3c7f52d2c9c8.zip
kernel_samsung_smdk4412-e1a61f0e687dbaa5106b2df60daf3c7f52d2c9c8.tar.gz
kernel_samsung_smdk4412-e1a61f0e687dbaa5106b2df60daf3c7f52d2c9c8.tar.bz2
zram: support REQ_DISCARD
zram is ram based block device and can be used by backend of filesystem. When filesystem deletes a file, it normally doesn't do anything on data block of that file. It just marks on metadata of that file. This behavior has no problem on disk based block device, but has problems on ram based block device, since we can't free memory used for data block. To overcome this disadvantage, there is REQ_DISCARD functionality. If block device support REQ_DISCARD and filesystem is mounted with discard option, filesystem sends REQ_DISCARD to block device whenever some data blocks are discarded. All we have to do is to handle this request. This patch implements to flag up QUEUE_FLAG_DISCARD and handle this REQ_DISCARD request. With it, we can free memory used by zram if it isn't used. [akpm@linux-foundation.org: tweak comments] Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Minchan Kim <minchan@kernel.org> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Jerome Marchand <jmarchan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Change-Id: I9831047aa7ab4162bf761fdd8897e2d1e7a4b34f
Diffstat (limited to 'drivers/block/umem.c')
0 files changed, 0 insertions, 0 deletions