aboutsummaryrefslogtreecommitdiff
path: root/kernel-2.4
diff options
context:
space:
mode:
authorplougher <plougher>2006-02-22 22:13:59 +0000
committerMohamad Ayyash <mkayyash@google.com>2015-02-23 12:33:42 -0800
commitaf371d91a8865df5ab3079887b86c76a48b6e405 (patch)
treee90a5ae2d6281876f27d93e7a9756ab62fd1934e /kernel-2.4
parent74c92837ec2a569abce50d66d1ceff735c619785 (diff)
downloadsquashfs-tools-af371d91a8865df5ab3079887b86c76a48b6e405.tar.gz
Starting to merge some of the 2.2-r2 improvements. This adds support for
the embedded system configure options.
Diffstat (limited to 'kernel-2.4')
-rwxr-xr-xkernel-2.4/fs/squashfs/inode.c7
-rwxr-xr-xkernel-2.4/include/linux/squashfs_fs.h14
2 files changed, 15 insertions, 6 deletions
diff --git a/kernel-2.4/fs/squashfs/inode.c b/kernel-2.4/fs/squashfs/inode.c
index 06006cb..18496bd 100755
--- a/kernel-2.4/fs/squashfs/inode.c
+++ b/kernel-2.4/fs/squashfs/inode.c
@@ -456,9 +456,8 @@ SQSH_EXTERN struct squashfs_fragment_cache *get_cached_fragment(struct super_blo
SQUASHFS_CACHED_FRAGMENTS;
if (msblk->fragment[i].data == NULL)
- if (!(msblk->fragment[i].data = kmalloc
- (SQUASHFS_FILE_MAX_SIZE,
- GFP_KERNEL))) {
+ if (!(msblk->fragment[i].data = SQUASHFS_ALLOC
+ (SQUASHFS_FILE_MAX_SIZE))) {
ERROR("Failed to allocate fragment "
"cache block\n");
up(&msblk->fragment_mutex);
@@ -1981,7 +1980,7 @@ static void squashfs_put_super(struct super_block *s)
kfree(sbi->block_cache[i].data);
if (sbi->fragment)
for (i = 0; i < SQUASHFS_CACHED_FRAGMENTS; i++)
- kfree(sbi->fragment[i].data);
+ SQUASHFS_FREE(sbi->fragment[i].data);
kfree(sbi->fragment);
kfree(sbi->block_cache);
kfree(sbi->read_data);
diff --git a/kernel-2.4/include/linux/squashfs_fs.h b/kernel-2.4/include/linux/squashfs_fs.h
index 8a8a105..9b9c455 100755
--- a/kernel-2.4/include/linux/squashfs_fs.h
+++ b/kernel-2.4/include/linux/squashfs_fs.h
@@ -28,6 +28,18 @@
#define CONFIG_SQUASHFS_2_0_COMPATIBILITY
#endif
+#ifdef CONFIG_SQUASHFS_VMALLOC
+#define SQUASHFS_ALLOC(a) vmalloc(a)
+#define SQUASHFS_FREE(a) vfree(a)
+#else
+#define SQUASHFS_ALLOC(a) kmalloc(a, GFP_KERNEL)
+#define SQUASHFS_FREE(a) kfree(a)
+#endif
+#ifdef CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE
+#define SQUASHFS_CACHED_FRAGMENTS CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE
+#else
+#define SQUASHFS_CACHED_FRAGMENTS 3
+#endif
#define SQUASHFS_MAJOR 3
#define SQUASHFS_MINOR 0
#define SQUASHFS_MAGIC 0x73717368
@@ -160,8 +172,6 @@
#define SQUASHFS_FRAGMENT_INDEX_BYTES(A) (SQUASHFS_FRAGMENT_INDEXES(A) *\
sizeof(long long))
-#define SQUASHFS_CACHED_FRAGMENTS 3
-
/* cached data constants for filesystem */
#define SQUASHFS_CACHED_BLKS 8