2007-03-21 15:12:56 +00:00
|
|
|
ifneq ($(KERNELRELEASE),)
|
|
|
|
# kbuild part of makefile
|
2007-02-02 14:18:22 +00:00
|
|
|
|
2008-10-09 15:52:35 +00:00
|
|
|
obj-$(CONFIG_BTRFS_FS) := btrfs.o
|
2007-03-22 16:13:20 +00:00
|
|
|
btrfs-y := super.o ctree.o extent-tree.o print-tree.o root-tree.o dir-item.o \
|
2008-08-19 18:21:57 +00:00
|
|
|
file-item.o inode-item.o inode-map.o disk-io.o \
|
2008-09-29 19:18:18 +00:00
|
|
|
transaction.o inode.o file.o tree-defrag.o \
|
2008-01-24 21:13:08 +00:00
|
|
|
extent_map.o sysfs.o struct-funcs.o xattr.o ordered-data.o \
|
2008-07-28 19:32:19 +00:00
|
|
|
extent_io.o volumes.o async-thread.o ioctl.o locking.o orphan.o \
|
Btrfs: Add zlib compression support
This is a large change for adding compression on reading and writing,
both for inline and regular extents. It does some fairly large
surgery to the writeback paths.
Compression is off by default and enabled by mount -o compress. Even
when the -o compress mount option is not used, it is possible to read
compressed extents off the disk.
If compression for a given set of pages fails to make them smaller, the
file is flagged to avoid future compression attempts later.
* While finding delalloc extents, the pages are locked before being sent down
to the delalloc handler. This allows the delalloc handler to do complex things
such as cleaning the pages, marking them writeback and starting IO on their
behalf.
* Inline extents are inserted at delalloc time now. This allows us to compress
the data before inserting the inline extent, and it allows us to insert
an inline extent that spans multiple pages.
* All of the in-memory extent representations (extent_map.c, ordered-data.c etc)
are changed to record both an in-memory size and an on disk size, as well
as a flag for compression.
From a disk format point of view, the extent pointers in the file are changed
to record the on disk size of a given extent and some encoding flags.
Space in the disk format is allocated for compression encoding, as well
as encryption and a generic 'other' field. Neither the encryption or the
'other' field are currently used.
In order to limit the amount of data read for a single random read in the
file, the size of a compressed extent is limited to 128k. This is a
software only limit, the disk format supports u64 sized compressed extents.
In order to limit the ram consumed while processing extents, the uncompressed
size of a compressed extent is limited to 256k. This is a software only limit
and will be subject to tuning later.
Checksumming is still done on compressed extents, and it is done on the
uncompressed version of the data. This way additional encodings can be
layered on without having to figure out which encoding to checksum.
Compression happens at delalloc time, which is basically singled threaded because
it is usually done by a single pdflush thread. This makes it tricky to
spread the compression load across all the cpus on the box. We'll have to
look at parallel pdflush walks of dirty inodes at a later time.
Decompression is hooked into readpages and it does spread across CPUs nicely.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
2008-10-29 18:49:59 +00:00
|
|
|
ref-cache.o export.o tree-log.o acl.o free-space-cache.o zlib.o \
|
2009-03-13 14:10:06 +00:00
|
|
|
compression.o delayed-ref.o
|
2007-03-21 15:12:56 +00:00
|
|
|
else
|
2007-01-26 21:38:42 +00:00
|
|
|
|
2007-03-21 15:12:56 +00:00
|
|
|
# Normal Makefile
|
2007-02-26 15:40:21 +00:00
|
|
|
|
2007-03-21 15:12:56 +00:00
|
|
|
KERNELDIR := /lib/modules/`uname -r`/build
|
2008-09-24 15:05:53 +00:00
|
|
|
all:
|
2008-10-09 15:52:35 +00:00
|
|
|
$(MAKE) -C $(KERNELDIR) M=`pwd` CONFIG_BTRFS_FS=m modules
|
2008-07-23 16:12:13 +00:00
|
|
|
|
2007-09-14 14:22:19 +00:00
|
|
|
modules_install:
|
2007-09-14 13:43:53 +00:00
|
|
|
$(MAKE) -C $(KERNELDIR) M=`pwd` modules_install
|
2007-09-14 14:22:19 +00:00
|
|
|
clean:
|
2007-07-25 18:04:51 +00:00
|
|
|
$(MAKE) -C $(KERNELDIR) M=`pwd` clean
|
2007-09-14 14:22:19 +00:00
|
|
|
|
2007-03-21 15:12:56 +00:00
|
|
|
endif
|