cramfs filesystem patch for 2.4.0
Subsystems (3)
Here is an update of my patch for the cramfs filesystem for 2.4.0 with a few minor additions. See below for the list of changes.
It's backward-compatible and only modifies cramfs code (aside from adding cramfs to struct super_block). All old cramfs images will still work and new cramfs images are mountable on old kernels if you avoid using new features: holes (holes require kernel 2.3.39 or later) and padding for a boot sector (you should have a new kernel in that case).
Most of this code has been fairly well-tested, but a few features are newer and less well-tested (like the directory sorting). If you use cramfs, please try it out and let me know if you have any feedback, comments, or patches. (I've started looking at adding some of the existing patches, although I'll need help testing most of them.)
Dan
------------------------------------------------------------------------
15 Jan 2001:
- update for 2.4.0
- move fs/cramfs/cramfs.h to include/linux/cramfs_fs.h
- add magic to in-memory version of cramfs superblock (for initrd support)
- renamed a few #defines in cramfs_fs.h
07 Dec 2000:
superblock changes:
- revised fsid field (still unique, contains useful fs info:
a CRC, edition number for implementation-specific versioning, block and file counts for statfs)
- size field is now used
- new feature flags (fsid version 2, holes, shifted root for boot loader, directory sorting)
inode.c
- proper checking for device size (torvalds)
- speed up IO a bit - read in the block asynchronously rather than using bread() on them one by one (torvalds)
- early directory lookup exit (since directories are now sorted)
- add reporting of blocks and blksize for statfs
- removed superfluous test for cramfs signature
cramfsck.c
- new program to fsck/extract cramfs images
mkcramfs.c
- CRC added to filesystem image
- allow holes to be created (see -z option)
- support for a cramfs boot loader (see -p option)
- support for inserting an kernel image into a cramfs image (see -i option)
- directory sorting (more consistent images, allows faster lookups)
- bug fix: allocate enough RAM for the fs image (small images)
- bug fix: work around a bug in ramfs where it would incorrectly report the number of blocks for file (a problem when creating cramfs images from a ramfs filesystem)
- options to set name/edition number in superblock (-n and -e, respectively)
cramfs.txt:
- added entry for /etc/magic to cramfs.txt documentation
cleanup:
- moved width definitions to cramfs.h
- define special cramfs super block
------------------------------------------------------------------------
Documentation/filesystems/cramfs.txt +15 -0
@@ -47,6 +47,21 @@ mind the filesystem becoming unreadable to future kernels. +For /usr/share/magic +------------------ + +0 long 0x28cd3d45 Linux cramfs +>4 long x size %d +>8 long x flags 0x%x +>12 long x future 0x%x +>16 string >\0 signature "%.16s" +>32 long x fsid.crc 0x%x +>36 long x fsid.edition %d +>40 long x fsid.blocks %d +>44 long x fsid.files %d +>48 string >\0 name "%.16s" + + Hacker Notes ------------
fs/cramfs/README +2 -2
@@ -14,11 +14,11 @@ <directory_structure> <data> -<superblock>: struct cramfs_super (see cramfs.h). +<superblock>: struct cramfs_super (see cramfs_fs.h). <directory_structure>: For each file: - struct cramfs_inode (see cramfs.h). + struct cramfs_inode (see cramfs_fs.h). Filename. Not generally null-terminated, but it is null-padded to a multiple of 4 bytes.
fs/cramfs/cramfs.h +0 -52
52 lines not on this page · raw message
fs/cramfs/inode.c +87 -20
184 lines not on this page · raw message
include/linux/cramfs_fs.h +89 -0
89 lines not on this page · raw message
include/linux/cramfs_fs_sb.h +15 -0
@@ -0,0 +1,15 @@ +#ifndef _CRAMFS_FS_SB +#define _CRAMFS_FS_SB + +/* +* cramfs super-block data in memory +*/ +struct cramfs_sb_info { +unsigned long magic; +unsigned long size; +unsigned long blocks; +unsigned long files; +unsigned long flags; +}; + +#endif
include/linux/fs.h +2 -0
@@ -658,6 +658,7 @@#include <linux/udf_fs_sb.h> #include <linux/ncp_fs_sb.h> #include <linux/usbdev_fs_sb.h> +#include <linux/cramfs_fs_sb.h> extern struct list_head super_blocks;
@@ -706,6 +707,7 @@struct udf_sb_info udf_sb;struct ncp_sb_info ncpfs_sb;struct usbdev_sb_info usbdevfs_sb; +struct cramfs_sb_info cramfs_sb;void *generic_sbp; } u;/*
scripts/cramfs/GNUmakefile +4 -3
@@ -1,7 +1,8 @@ -CFLAGS = -Wall -O2 -CPPFLAGS = -I../../fs/cramfs +CC = gcc +CFLAGS = -W -Wall -O2 -g +CPPFLAGS = -I../../include LDLIBS = -lz -PROGS = mkcramfs +PROGS = mkcramfs cramfsck all: $(PROGS)
scripts/cramfs/cramfsck.c +588 -0
588 lines not on this page · raw message
scripts/cramfs/mkcramfs.c +249 -120
569 lines not on this page · raw message
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/