diff -urN -X dontdiff linux/Documentation/Configure.help 2325-bfs/Documentation/Configure.help --- linux/Documentation/Configure.help Fri Oct 29 21:19:49 1999 +++ 2325-bfs/Documentation/Configure.help Wed Nov 3 12:05:45 1999 @@ -7970,14 +7970,16 @@ compiled as a module, and so this could be dangerous. Most everyone wants to say Y here. -SCO UnixWare BFS Support +SCO UnixWare BFS Support (EXPERIMENTAL) CONFIG_BFS_FS Boot Filesystem (BFS) is a filesystem used under SCO UnixWare to allow bootloader access the kernel image and other important files during the boot process. It is usually mounted under /stand and corresponds to the slice marked as "STAND" in the UnixWare partition. This is useful if you want to access files on your /stand - slice from Linux. If you don't know what it is, say N. + slice from Linux. More information on this filesystem can be found in + Documentation/filesystems/bfs.txt file. If you do not know what it is, + say N. If you want to compile this as a module ( = code which can be inserted in and removed from the running kernel whenever you want), diff -urN -X dontdiff linux/Documentation/filesystems/bfs.txt 2325-bfs/Documentation/filesystems/bfs.txt --- linux/Documentation/filesystems/bfs.txt Thu Oct 28 22:45:16 1999 +++ 2325-bfs/Documentation/filesystems/bfs.txt Wed Nov 3 12:09:54 1999 @@ -1,8 +1,13 @@ The BFS filesystem is used on SCO UnixWare machines for /stand slice. -There are no special mount options supported by bfs at this time. -You can mount it only read-only at this stage. Even if you attempt to -mount it read-write it will be automatically mounted read-only, unless -you have enabled "BFS write support" when configuring the kernel. +By default, if you attempt to mount it read-write it will be automatically +mounted read-only. If you want to enable (limited) write support, you need +to select "BFS write support" when configuring the kernel. The write support +at this stage is limited to the blocks preallocated for a given inode. +This means that writes beyond the value of inode->iu_eblock will fail with EIO. +In particular, this means you can create empty files but not write data to them +or you can write data to the existing files and increase their size but not the +number of blocks allocated to them. I am currently working on removing this +limitation, i.e. ability to migrate inodes within BFS filesystem. In order to access /stand partition under Linux you obviously need to know the partition number and the kernel must support UnixWare disk slices diff -urN -X dontdiff linux/fs/Config.in 2325-bfs/fs/Config.in --- linux/fs/Config.in Thu Oct 28 22:45:16 1999 +++ 2325-bfs/fs/Config.in Tue Nov 2 15:49:20 1999 @@ -14,6 +14,12 @@ tristate 'Amiga FFS filesystem support' CONFIG_AFFS_FS tristate 'Apple Macintosh filesystem support (EXPERIMENTAL)' CONFIG_HFS_FS # msdos filesystems +if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + tristate 'BFS filesystem (read only) support (EXPERIMENTAL)' CONFIG_BFS_FS + if [ "$CONFIG_BFS_FS" != "n" ]; then + bool ' BFS filesystem write support (DANGEROUS)' CONFIG_BFS_FS_WRITE + fi +fi tristate 'DOS FAT fs support' CONFIG_FAT_FS dep_tristate ' MSDOS fs support' CONFIG_MSDOS_FS $CONFIG_FAT_FS dep_tristate ' UMSDOS: Unix-like filesystem on top of standard MSDOS filesystem' CONFIG_UMSDOS_FS $CONFIG_MSDOS_FS @@ -58,12 +64,6 @@ fi tristate 'ROM filesystem support' CONFIG_ROMFS_FS tristate 'Second extended fs support' CONFIG_EXT2_FS -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - tristate 'BFS filesystem (read only) support (EXPERIMENTAL)' CONFIG_BFS_FS - if [ "$CONFIG_BFS_FS" != "n" ]; then - bool ' BFS filesystem write support (DANGEROUS)' CONFIG_BFS_FS_WRITE - fi -fi tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS if [ "$CONFIG_SYSV_FS" != "n" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then bool ' SYSV filesystem write support (DANGEROUS)' CONFIG_SYSV_FS_WRITE diff -urN -X dontdiff linux/fs/bfs/dir.c 2325-bfs/fs/bfs/dir.c --- linux/fs/bfs/dir.c Fri Oct 29 19:05:08 1999 +++ 2325-bfs/fs/bfs/dir.c Tue Nov 2 15:48:25 1999 @@ -51,7 +51,7 @@ while (f->f_pos < dir->i_size) { offset = f->f_pos & (BFS_BSIZE-1); - block = dir->iu_sblock + f->f_pos/BFS_BSIZE; + block = dir->iu_sblock + (f->f_pos >> BFS_BSIZE_BITS); bh = bread(dev, block, BFS_BSIZE); if (!bh) { f->f_pos += BFS_BSIZE - offset; diff -urN -X dontdiff linux/fs/bfs/file.c 2325-bfs/fs/bfs/file.c --- linux/fs/bfs/file.c Thu Oct 28 22:45:16 1999 +++ 2325-bfs/fs/bfs/file.c Wed Nov 3 13:43:43 1999 @@ -41,14 +41,14 @@ static int bfs_get_block(struct inode * inode, long block, struct buffer_head * bh_result, int create) { - if (!create) { + long phys = inode->iu_sblock + block; + if (!create || phys <= inode->iu_eblock) { bh_result->b_dev = inode->i_dev; - bh_result->b_blocknr = inode->iu_sblock + block; + bh_result->b_blocknr = phys; bh_result->b_state |= (1UL << BH_Mapped); return 0; - } else - DBG(KERN_ERR "BFS-fs: %s(create=%d) impossible!\n", - __FUNCTION__, create); + } + /* no support for file migration, working on it */ return -EIO; } diff -urN -X dontdiff linux/fs/bfs/inode.c 2325-bfs/fs/bfs/inode.c --- linux/fs/bfs/inode.c Fri Oct 29 19:05:08 1999 +++ 2325-bfs/fs/bfs/inode.c Tue Nov 2 15:49:29 1999 @@ -243,7 +243,6 @@ if (!tmpbuf) return; - memset(tmpbuf, 0, 400); for (i=s->su_lasti; i>=0; i--) { if (i>PAGE_SIZE-100) break; if (test_bit(i, s->su_imap)) diff -urN -X dontdiff linux/include/linux/bfs_fs.h 2325-bfs/include/linux/bfs_fs.h --- linux/include/linux/bfs_fs.h Thu Oct 28 22:45:16 1999 +++ 2325-bfs/include/linux/bfs_fs.h Wed Nov 3 10:15:25 1999 @@ -32,7 +32,7 @@ __u32 i_atime; __u32 i_mtime; __u32 i_ctime; - __u8 i_padding[16]; + __u32 i_padding[4]; }; #define BFS_NAMELEN 14 @@ -55,7 +55,7 @@ __s32 s_bto; char s_fsname[6]; char s_volume[6]; - __u8 s_padding[472]; + __u32 s_padding[118]; }; #define BFS_NZFILESIZE(ip) \ .