debian/ 0000755 0000000 0000000 00000000000 12230517502 007163 5 ustar debian/flashcache_destroy.markdown 0000644 0000000 0000000 00000001575 12230476512 014576 0 ustar % FLASHCACHE_DESTROY(8) flashcache_destroy
%
% September 2011
# NAME
flashcache_destroy - destroy an existing flashcache volume
# DESCRIPTION
The purpose of the **flashcache_destroy** command is to Clear all meta data from
cache device. Beware, this will cause data loss on the affected devices.
# SYNOPSIS
flashcache_destroy *cache_devname*
# EXAMPLE
flashcache_destroy */dev/sdc*
: Destroy the existing cache on /dev/sdc. All data is lost!
# SEE ALSO
`flashcache_create`(8), `flashcache_load`(8)
*README* and other documents in **/usr/share/doc/flashcache-utils**
The flashcache source code and all documentation may be downloaded from
.
# AUTHORS
Flashcache is developed by Mohan Srinivasan
This man page was written by Dmitry Smirnov
for Debian GNU/Linux (but may be used by others).
debian/patches/ 0000755 0000000 0000000 00000000000 12230500253 010605 5 ustar debian/patches/usable-makefile.patch 0000644 0000000 0000000 00000003637 12230500253 014665 0 ustar Author: Arno Töll
Subject: Clean the Makefile from utils, not needed for the DKMS module
Last-Update: 08/17/2011
Forwarded: not-needed
The upstream Makefiles ship a combined Makefile to build both, the DKMS kernel
module, as well as the user space utilities. For Debian, those things a being
split into independent packages, where the DKMS module binary is built on the
installation site.
Hence its helpful, to remove references to the utils, which are not available or
required on the installation site.
* src/Makefile - Remove utils targets
* flashcache-wt/Makefile - ditto
--- a/flashcache-wt/src/Makefile
+++ b/flashcache-wt/src/Makefile
@@ -9,14 +9,11 @@
all:
make -C $(KERNEL_TREE) M=$(PWD) modules
- $(CC) $(UTILS_CFLAGS) -o utils/flashcache_wt_create utils/flashcache_wt_create.c
install: all
install -o root -g root -m 0755 -d /lib/modules/$(KERNEL_SOURCE_VERSION)/extra/flashcache/
install -o root -g root -m 0755 flashcache-wt.ko /lib/modules/$(KERNEL_SOURCE_VERSION)/extra/flashcache/
depmod -a
- install -o root -g root -m 0755 utils/flashcache_wt_create /sbin/
clean:
make -C $(KERNEL_TREE) M=$(PWD) clean
- rm -f utils/flashcache_wt_create
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,4 +1,4 @@
-COMMIT_REV ?= $(shell git describe --always --abbrev=12)
+COMMIT_REV ?= $(shell dpkg-query -W -f='$${Version}' flashcache-dkms | awk -F "-" '{print $$1}' | cut -d\: -f2)
KERNEL_SOURCE_VERSION ?= $(shell uname -r)
KERNEL_TREE ?= /lib/modules/$(KERNEL_SOURCE_VERSION)/build
@@ -28,7 +28,7 @@
flashcache-objs := flashcache_conf.o flashcache_main.o flashcache_subr.o flashcache_ioctl.o flashcache_procfs.o flashcache_reclaim.o
.PHONY: all
-all: modules utils
+all: modules
.PHONY: modules
modules: $(RHEL5_SETUP)
@@ -53,7 +53,7 @@
make -C ocf install
.PHONY: install
-install: modules_install utils_install ocf_install
+install: modules_install ocf_install
.PHONY: clean
clean:
debian/patches/honor-cflags-and-ldflags.patch 0000644 0000000 0000000 00000002243 12230476513 016376 0 ustar Description: Honor build flags in Makefile
The Makefile ignores CFLAGS/LDFLAGS the user may inject through dpkg-buildflags
or any other method. To fix this, the patch below makes sure those flags are
being injected into the build process when needed.
.
src/utils/Makefile: Add flags where needed
Forwarded: yes
Author: Arno Töll
--- a/src/utils/Makefile
+++ b/src/utils/Makefile
@@ -7,33 +7,33 @@
all: $(PROGRAMS)
get_agsize: get_agsize.o
- $(CC) $^ -o $@
+ $(LINK.o) $^ -o $@
-include get_agsize.d
flashcache_create: flashcache_create.o
- $(CC) $^ -o $@
+ $(LINK.o) $^ -o $@
-include flashcache_create.d
flashcache_destroy: flashcache_destroy.o
- $(CC) $^ -o $@
+ $(LINK.o) $^ -o $@
-include flashcache_destroy.d
flashcache_load: flashcache_load.o
- $(CC) $^ -o $@
+ $(LINK.o) $^ -o $@
-include flashcache_load.d
flashcache_setioctl: flashcache_setioctl.o
- $(CC) $^ -o $@
+ $(LINK.o) $^ -o $@
-include flashcache_setioctl.d
%.o: %.c
- $(CC) -c $(CFLAGS) $*.c -o $*.o
- @$(CC) -MM $(CFLAGS) -MF $*.d -MT $*.o $*.c
+ $(COMPILE.c) $*.c -o $*.o
+ @$(COMPILE.c) -MM -MF $*.d -MT $*.o $*.c
.PHONY: install
install: $(PROGRAMS)
debian/patches/series 0000644 0000000 0000000 00000000065 12230476513 012036 0 ustar usable-makefile.patch
honor-cflags-and-ldflags.patch
debian/flashcache.markdown 0000644 0000000 0000000 00000004054 12230476512 013020 0 ustar % FLASHCACHE(7) flashcache
%
% September 2011
# NAME
flashcache - overview of operation
# SYNOPSIS
modprobe flashcache
Flashcache consists of a kernel module and userspace utilities. The module is
named "flashcache". The kernel module can be controlled with *flashcache_create*(8),
*flashcache_load*(8) and *flashcache_destroy*(8) utilities.
# DESCRIPTION
Flashcache is a block cache for Linux, built as a kernel module,
using the device mapper. Flashcache supports **writeback**, **writethrough** and
**writearound** caching modes. See *flashcache_create*(8) for a description
of caching modes.
Flascache allows one to use a fast block device such as Solid State Drives (SSD)
as cache to accelerate a slower drive used as backstore.
Originally, Flashcache was built as a block device cache for I/O intensive
database applications, for example to run an accelerated InnoDB store for
*mysqld*(8), but it can be used as general purpose backend for filesystems as
well.
# USAGE
Before using Flashcache, it might be a good idea to check if device mapper works
properly. Assuming the partition /dev/md0p1 shall be used as flash cache, one
may try to create a linear device with following command:
**echo 0 1024 linear /dev/md0p1 0 | dmsetup create tmpdisk**
It this works, *flashcache_create* should be able to create its device.
Remove tmpdisk with command:
**dmsetup remove tmpdisk**
Before creating a flashcache device using the *flashcache_create* command, the
deivce must not be mounted.
# SEE ALSO
`flashcache_create`(8), `flashcache_load`(8), `flashcache_destroy`(8)
*README* and other documents in **/usr/share/doc/flashcache-utils**. In
particular, see **flashcache-sa-guide.txt** for configuring the flashcache
kernel module through its */proc* interface.
The flashcache source code and all documentation may be downloaded from
.
# AUTHORS
Flashcache is developed by Mohan Srinivasan
This man page was written by Dmitry Smirnov
for Debian GNU/Linux (but may be used by others).
debian/compat 0000644 0000000 0000000 00000000002 12230476512 010366 0 ustar 9
debian/flashcache-dkms.install 0000644 0000000 0000000 00000000040 12230500511 013552 0 ustar debian/tmp/usr/src/flashcache-*
debian/control 0000644 0000000 0000000 00000004135 12230501377 010574 0 ustar Source: flashcache
Section: kernel
Priority: optional
Maintainer: Liang Guo
Uploaders: Dmitry Smirnov
Build-Depends: debhelper (>= 9), dkms, pandoc, pandoc-data
Standards-Version: 3.9.4
Homepage: https://github.com/facebook/flashcache
VCS-Browser: http://anonscm.debian.org/git/collab-maint/flashcache.git
VCS-Git: git://anonscm.debian.org/collab-maint/flashcache.git
Package: flashcache-dkms
Architecture: all
Depends: dkms (>= 1.95), ${misc:Depends}
Description: write-back block device cache for Linux (DKMS version)
Flashcache is a write-back block device cache for Linux. Using the Linux
device mapper (DM) it provides an overlay mapper, to cache chunks of
data on a high speed caching device like a solid-state drive for fast
read access.
.
Flashcache supports FIFO and LRU cache sets, is configurable and error
resistant. It comes with a DKMS kernel module and a corresponding user
land for command and control. Alternatively it can be configured as
write-through and write-around flash cache, which does not store any
persitent data in the flash volume, hence purging the cache upon reboot.
.
This package provides the DKMS kernel module.
.
Warning: Flashcache is known not to work on the i686 (x86_32) architecture and
possibly others.
Package: flashcache-utils
Architecture: linux-any
Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends},
flashcache-dkms (= ${source:Version}), lsb-base (>= 3.2-14), module-init-tools, dmsetup
Recommends: udev, bsdutils (>= 1:2.17.2)
Section: utils
Description: write-back block device cache for Linux (user space utilities)
Flashcache is a write-back block device cache for Linux. Using the Linux
device mapper (DM) it provides an overlay mapper, to cache chunks of
data on a high speed caching device like a solid-state drive for fast
read access.
.
Flashcache supports FIFO and LRU cache sets, is configurable and error
resistant. It comes with a DKMS kernel module and a corresponding user
land for command and control.
.
This package provides user space utilities, required to control the kernel
module.
debian/flashcache-utils.manpages 0000644 0000000 0000000 00000000023 12230476512 014117 0 ustar man/*.8
debian/*.8
debian/README.Debian 0000644 0000000 0000000 00000004633 12230476512 011237 0 ustar flashcache-utils for Debian
---------------------------
* flashcache-utils installs a udev handler to invoke
`/sbin/flashcache_load` for every available block device. This allows one to
mount Flashcache devices from `/etc/fstab`. To mount a flashcache enabled
device from `/etc/fstab` first a mapping between a cached device and a cache
should be established. It can be done using command adapted to personal
requirements like:
flashcache_create -p back cache_dev /dev/SSD /dev/disk/by-id/SLOW_DISK
This makes `/dev/mapper/cache_dev` a pass-through block device which can
be mounted directly, or from `/etc/fstab` after creating a filesystem on
it by using the following entry:
/dev/mapper/cache_dev /mnt/slow_d ext4 defaults 0 0
After a reboot the mapping between `/dev/disk/by-id/SLOW_D` and `/dev/SSD`
can be restored by invoking the command below which recreates
`/dev/mapper/cache_dev`:
/sbin/flashcache_load /dev/ssd
This is exactly what the udev handler does as well. Please note that
scanning for available partitions as performed by utilities like gparted,
will wake up udev and mount existing Flashcache device(s) unless already
mounted.
* Because block devices may be arbitrarly (re-)named, it should be avoided to
use device names like `/dev/sd[a-z]`. It is recommended to create the
Flashcache device using `/dev/disk/by-id/` identifiers or by using
`/dev/disk/by-uuid/` instead. For the latter case, the file system
should exist prior to `/sbin/flashcache_create` invocation. The blkid(8)
utility may be useful to find UUID of a file system to cache.
* Using Flashcache for root file system is not supported.
* WARNING: Although it is possible to mount a cached file system after
binding it to flashcache device, this is going to cause irrevocable data
corruption if that is tried without destroying the Flashcache device by
using `/sbin/flashcache_destroy` first. If a write-back Flashcache device
associated with a disk or partition, all access to such a disk or partition
should be done through the Flashcache device mapping only.
* WARNING: Data corruption has been reported when using a loopback device
for the cache device.
* Please read Flashcache documentation in
`/usr/share/doc/flashcache-utils`
and familiarise yourself with basic concepts and commands.
debian/flashcache_create.markdown 0000644 0000000 0000000 00000007225 12230476512 014346 0 ustar % FLASHCACHE_CREATE(8) flashcache_create
%
% September 2011
# NAME
flashcache_create - create a new flashcache volume
# DESCRIPTION
**flashcache_create** initializes a new flashcache volume from unformated block
devices. It creates flashcache meta data and provides new volumes though their
volume mappings.
# SYNOPSIS
flashcache_create -p *back*|*around*|*thru* [-s *cache size*] [-b *block size*] [-v]
*cachedevname* *cache_devname* *disk_devname*
# OPTIONS
-v
: verbose
-p
: *cache mode*. Required argument. Specify any supported option:
(write-)**back**, (write-)**thru** or (write-)**around**. Their respective
implications are denoted below.
-s
: *cache size*. Optional argument. By default, flashcache will use the
auto-detected full cache device size. When present, the given cache size is used
instead. The expected units are sectors, however any value can be suffixed by
"k", "m" or "g" to interpret the argument in kilo-, mega- or gigabytes
respectively.
-b
: *block size*. Optional argument. Defaults to 4KB. Must be a power of 2.
The default units is sectors. However, *k* can be specified as unit type as
well. (A 4KB blocksize is the correct choice for the vast majority of
applications.
-f
: force create. Bypass all sanity checks (for example for the sector size).
Use with care.
# CACHING MODES
The following caching modes are supported:
*Writethrough* (**thru**) - safest mode, all writes are cached to the cache
device but are also being written to disk immediately. If the used cache device has
a lower write performance than the backend disk (many early generation SSD
drives manufactured between 2008-2010 are known for such a poor write
performance) enabling the writethrough mode may decrease the system write
performance. All disk reads are cached (tunable through flashcache's */proc*
interface).
*Writearound* (**ardound**) - again, very safe, writes are not written to the
cache device, but directly to the backend disk instead. Disk blocks will only
be cached after they are read. All disk reads are cached (tunable through
flashcache's */proc* interface).
*Writeback* (**back**) - fastest mode but less safe. Writes only go to the
cache device initially, and are being written to the backend disk later,
depending on configured system policie. All disk reads are
cached (tunable through flashcache's */proc* interface).
# CACHE PERSISTENCE
Writethru and Writearound caches are not persistent across a device removal
or a reboot. Only Writeback caches are persistent across device removals
and reboots. This reinforces 'writeback is fastest', 'writethrough is safest'.
# EXAMPLES
**flashcache_create** -p back -s 1g -b 4k cachedev /dev/sdc /dev/sdb
: Creates a 1GB writeback cache volume with a 4KB block size on the cache
device /dev/sdc to cache the disk volume /dev/sdb. The name of the device
created is "cachedev".
**flashcache_create** -p thru -s 2097152 -b 8 cachedev /dev/sdc /dev/sdb
: Same as above but creates a write through cache with units specified in
sectors instead. The name of the device created is "cachedev".
# SEE ALSO
`flashcache_load`(8), `flashcache_destroy`(8)
*README* and other documents in **/usr/share/doc/flashcache-utils**. In
particular, see **flashcache-sa-guide.txt** for configuring the flashcache
kernel module through its */proc* interface.
The flashcache source code and all documentation may be downloaded from
.
# AUTHORS
Flashcache is developed by Mohan Srinivasan
This man page was written by Dmitry Smirnov
for Debian GNU/Linux (but may be used by others).
debian/flashstat.markdown 0000644 0000000 0000000 00000003345 12230476512 012732 0 ustar % FLASHSTAT(8) flashstat
# NAME
flashstat - Display flashcache statistic information
# DESCRIPTION
The purpose of the **flashstat** command is to periodically display
flashcache statistic information
# SYNOPSIS
flashstat [-h] [-i \