Skip to content

Commit

Permalink
Squashfs: remove the FILE_CACHE option
Browse files Browse the repository at this point in the history
FILE_DIRECT is working fine and offers faster results and lower memory
footprint.

Removing FILE_CACHE makes our life easier because we don't have to
maintain 2 differents function that does the same thing.

Signed-off-by: Adrien Schildknecht <[email protected]>
Change-Id: I6689ba74d0042c222a806f9edc539995e8e04c6b
  • Loading branch information
schischi authored and pundiramit committed Apr 10, 2017
1 parent 2445eaa commit 3de0af4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 109 deletions.
28 changes: 0 additions & 28 deletions fs/squashfs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,6 @@ config SQUASHFS

If unsure, say N.

choice
prompt "File decompression options"
depends on SQUASHFS
help
Squashfs now supports two options for decompressing file
data. Traditionally Squashfs has decompressed into an
intermediate buffer and then memcopied it into the page cache.
Squashfs now supports the ability to decompress directly into
the page cache.

If unsure, select "Decompress file data into an intermediate buffer"

config SQUASHFS_FILE_CACHE
bool "Decompress file data into an intermediate buffer"
help
Decompress file data into an intermediate buffer and then
memcopy it into the page cache.

config SQUASHFS_FILE_DIRECT
bool "Decompress files directly into the page cache"
help
Directly decompress file data into the page cache.
Doing so can significantly improve performance because
it eliminates a memcpy and it also removes the lock contention
on the single buffer.

endchoice

choice
prompt "Decompressor parallelisation options"
depends on SQUASHFS
Expand Down
3 changes: 1 addition & 2 deletions fs/squashfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
obj-$(CONFIG_SQUASHFS) += squashfs.o
squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o
squashfs-y += namei.o super.o symlink.o decompressor.o
squashfs-$(CONFIG_SQUASHFS_FILE_CACHE) += file_cache.o
squashfs-$(CONFIG_SQUASHFS_FILE_DIRECT) += file_direct.o page_actor.o
squashfs-y += file_direct.o page_actor.o
squashfs-$(CONFIG_SQUASHFS_DECOMP_SINGLE) += decompressor_single.o
squashfs-$(CONFIG_SQUASHFS_DECOMP_MULTI) += decompressor_multi.o
squashfs-$(CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU) += decompressor_multi_percpu.o
Expand Down
38 changes: 0 additions & 38 deletions fs/squashfs/file_cache.c

This file was deleted.

42 changes: 1 addition & 41 deletions fs/squashfs/page_actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,6 @@
* the COPYING file in the top-level directory.
*/

#ifndef CONFIG_SQUASHFS_FILE_DIRECT
struct squashfs_page_actor {
void **page;
int pages;
int length;
int next_page;
};

static inline struct squashfs_page_actor *squashfs_page_actor_init(void **page,
int pages, int length)
{
struct squashfs_page_actor *actor = kmalloc(sizeof(*actor), GFP_KERNEL);

if (actor == NULL)
return NULL;

actor->length = length ? : pages * PAGE_CACHE_SIZE;
actor->page = page;
actor->pages = pages;
actor->next_page = 0;
return actor;
}

static inline void *squashfs_first_page(struct squashfs_page_actor *actor)
{
actor->next_page = 1;
return actor->page[0];
}

static inline void *squashfs_next_page(struct squashfs_page_actor *actor)
{
return actor->next_page == actor->pages ? NULL :
actor->page[actor->next_page++];
}

static inline void squashfs_finish_page(struct squashfs_page_actor *actor)
{
/* empty */
}
#else
struct squashfs_page_actor {
union {
void **buffer;
Expand Down Expand Up @@ -77,5 +37,5 @@ static inline void squashfs_finish_page(struct squashfs_page_actor *actor)
{
actor->squashfs_finish_page(actor);
}
#endif

#endif

0 comments on commit 3de0af4

Please sign in to comment.