linux/drivers
Joonsoo Kim f4659d8e62 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>
2014-04-07 16:36:02 -07:00
..
accessibility
acpi More ACPI and power management updates for 3.15-rc1 2014-04-02 14:10:21 -07:00
amba ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
ata Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-04-02 16:23:38 -07:00
atm
auxdisplay
base Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-04-02 16:23:38 -07:00
bcma
block zram: support REQ_DISCARD 2014-04-07 16:36:02 -07:00
bluetooth Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-04-02 20:53:45 -07:00
bus ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
cdrom
char ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
clk The clock framework changes for 3.15 look similar to past pull requests. 2014-04-05 18:39:18 -07:00
clocksource ARM: SoC: cleanups for 3.15 2014-04-05 13:51:19 -07:00
connector Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-04-02 20:53:45 -07:00
cpufreq ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
cpuidle ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2014-04-03 09:28:16 -07:00
dca
devfreq
dio
dma Merge branch 'devel-stable' into for-next 2014-04-04 00:33:49 +01:00
edac Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2014-04-04 09:50:07 -07:00
eisa
extcon
firewire
firmware Driver core / sysfs patches for 3.15-rc1 2014-04-01 16:28:19 -07:00
fmc
gpio ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
gpu ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
hid Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2014-04-04 09:50:07 -07:00
hsi
hv
hwmon Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging 2014-04-05 18:45:11 -07:00
hwspinlock
i2c
ide
idle
iio Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2014-04-02 16:24:28 -07:00
infiniband Main batch of InfiniBand/RDMA changes for 3.15: 2014-04-03 16:57:19 -07:00
input pwm: Changes for v3.15-rc1 2014-04-05 18:32:31 -07:00
iommu IOMMU Upates for Linux v3.15 2014-04-05 18:46:26 -07:00
ipack
irqchip ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
isdn
leds
lguest drivers/lguest/page_tables.c: rename do_set_pte() 2014-04-07 16:35:52 -07:00
macintosh
mailbox
mcb
md . Fix dm-cache corruption caused by discard_block_size > 2014-04-05 18:49:31 -07:00
media Merge branch 'topic/exynos' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2014-04-05 13:10:00 -07:00
memory
memstick
message
mfd ARM: SoC: device tree changes 2014-04-05 15:29:04 -07:00
misc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-04-02 16:23:38 -07:00
mmc Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2014-04-05 13:20:43 -07:00
mtd ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
net Main batch of InfiniBand/RDMA changes for 3.15: 2014-04-03 16:57:19 -07:00
nfc
ntb
nubus
of Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2014-04-04 09:50:07 -07:00
oprofile
parisc
parport
pci Nothing major: the stricter permissions checking for sysfs broke 2014-04-06 09:38:07 -07:00
pcmcia
phy ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
pinctrl This is the bulk of GPIO changes for v3.15: 2014-04-03 16:44:15 -07:00
platform
pnp More ACPI and power management updates for 3.15-rc1 2014-04-02 14:10:21 -07:00
power
powercap
pps
ps3
ptp
pwm pwm: Changes for v3.15-rc1 2014-04-05 18:32:31 -07:00
rapidio
regulator Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-04-02 16:23:38 -07:00
remoteproc
reset
rpmsg
rtc ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-04-02 20:53:45 -07:00
sbus
scsi Main batch of InfiniBand/RDMA changes for 3.15: 2014-04-03 16:57:19 -07:00
sfi
sh ARM: SoC: sh driver changes 2014-04-05 15:38:41 -07:00
sn
spi Merge branch 'mips-for-linux-next' of git://git.linux-mips.org/pub/scm/ralf/upstream-sfr 2014-04-02 13:40:50 -07:00
spmi
ssb
staging Nothing major: the stricter permissions checking for sysfs broke 2014-04-06 09:38:07 -07:00
target
tc
thermal ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
tty ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
uio
usb Merge branch 'for-linus' of git://ftp.arm.linux.org.uk/~rmk/linux-arm 2014-04-05 13:20:43 -07:00
uwb
vfio VFIO updates for v3.15 include: 2014-04-03 14:05:02 -07:00
vhost
video fbdev changes for 3.15 (main part) 2014-04-04 21:28:36 -07:00
virt
virtio
vlynq
vme
w1
watchdog ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
xen Support PCI devices with multiple MSIs, performance improvement for 2014-04-03 14:01:37 -07:00
zorro
Kconfig
Makefile