diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-04 19:48:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-04 19:48:37 -0400 |
commit | 044595d4e448305fbaec472eb7d22636d24e7d8c (patch) | |
tree | 5faee830194d778a9bb63317bc6ff7f8962a976b /fs/squashfs | |
parent | 1583171492eb514e267c7b51e96846b38de0f544 (diff) | |
parent | 7657cacf478940b995c2c73fdff981c13cc62c5c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next
* git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-next:
Squashfs: Add an option to set dev block size to 4K
Diffstat (limited to 'fs/squashfs')
-rw-r--r-- | fs/squashfs/Kconfig | 22 | ||||
-rw-r--r-- | fs/squashfs/squashfs_fs.h | 7 | ||||
-rw-r--r-- | fs/squashfs/super.c | 2 |
3 files changed, 30 insertions, 1 deletions
diff --git a/fs/squashfs/Kconfig b/fs/squashfs/Kconfig index 048b59d5b2f..c70111ebefd 100644 --- a/fs/squashfs/Kconfig +++ b/fs/squashfs/Kconfig | |||
@@ -78,6 +78,28 @@ config SQUASHFS_XZ | |||
78 | 78 | ||
79 | If unsure, say N. | 79 | If unsure, say N. |
80 | 80 | ||
81 | config SQUASHFS_4K_DEVBLK_SIZE | ||
82 | bool "Use 4K device block size?" | ||
83 | depends on SQUASHFS | ||
84 | help | ||
85 | By default Squashfs sets the dev block size (sb_min_blocksize) | ||
86 | to 1K or the smallest block size supported by the block device | ||
87 | (if larger). This, because blocks are packed together and | ||
88 | unaligned in Squashfs, should reduce latency. | ||
89 | |||
90 | This, however, gives poor performance on MTD NAND devices where | ||
91 | the optimal I/O size is 4K (even though the devices can support | ||
92 | smaller block sizes). | ||
93 | |||
94 | Using a 4K device block size may also improve overall I/O | ||
95 | performance for some file access patterns (e.g. sequential | ||
96 | accesses of files in filesystem order) on all media. | ||
97 | |||
98 | Setting this option will force Squashfs to use a 4K device block | ||
99 | size by default. | ||
100 | |||
101 | If unsure, say N. | ||
102 | |||
81 | config SQUASHFS_EMBEDDED | 103 | config SQUASHFS_EMBEDDED |
82 | bool "Additional option for memory-constrained systems" | 104 | bool "Additional option for memory-constrained systems" |
83 | depends on SQUASHFS | 105 | depends on SQUASHFS |
diff --git a/fs/squashfs/squashfs_fs.h b/fs/squashfs/squashfs_fs.h index b4a4e539a08..e8e14645de9 100644 --- a/fs/squashfs/squashfs_fs.h +++ b/fs/squashfs/squashfs_fs.h | |||
@@ -36,6 +36,13 @@ | |||
36 | #define SQUASHFS_FILE_SIZE 131072 | 36 | #define SQUASHFS_FILE_SIZE 131072 |
37 | #define SQUASHFS_FILE_LOG 17 | 37 | #define SQUASHFS_FILE_LOG 17 |
38 | 38 | ||
39 | /* default size of block device I/O */ | ||
40 | #ifdef CONFIG_SQUASHFS_4K_DEVBLK_SIZE | ||
41 | #define SQUASHFS_DEVBLK_SIZE 4096 | ||
42 | #else | ||
43 | #define SQUASHFS_DEVBLK_SIZE 1024 | ||
44 | #endif | ||
45 | |||
39 | #define SQUASHFS_FILE_MAX_SIZE 1048576 | 46 | #define SQUASHFS_FILE_MAX_SIZE 1048576 |
40 | #define SQUASHFS_FILE_MAX_LOG 20 | 47 | #define SQUASHFS_FILE_MAX_LOG 20 |
41 | 48 | ||
diff --git a/fs/squashfs/super.c b/fs/squashfs/super.c index 7438850c62d..2da1715452a 100644 --- a/fs/squashfs/super.c +++ b/fs/squashfs/super.c | |||
@@ -95,7 +95,7 @@ static int squashfs_fill_super(struct super_block *sb, void *data, int silent) | |||
95 | } | 95 | } |
96 | msblk = sb->s_fs_info; | 96 | msblk = sb->s_fs_info; |
97 | 97 | ||
98 | msblk->devblksize = sb_min_blocksize(sb, BLOCK_SIZE); | 98 | msblk->devblksize = sb_min_blocksize(sb, SQUASHFS_DEVBLK_SIZE); |
99 | msblk->devblksize_log2 = ffz(~msblk->devblksize); | 99 | msblk->devblksize_log2 = ffz(~msblk->devblksize); |
100 | 100 | ||
101 | mutex_init(&msblk->read_data_mutex); | 101 | mutex_init(&msblk->read_data_mutex); |