J4FS porting

J4FS stand for Jong Jang Jintae Jongmin File System. It is a File System based on LFS (Linear File Store).

/*
 * Copyright (C) 2008, 2009,  Samsung Electronics Co. Ltd. All Rights Reserved.
 *       Written by Linux Lab, MITs Development Team, Mobile Communication Division.
 */


Linux 3.1.x kernel porting notes

The patch at the bottom of this page is the porting of this "Flash oriented" filesystem to the 3.1.x kernel and the adaptation for the use over normal block devices. This means you can use loop device to mount a j4fs image.

Please remember that the param.lfs file is not a normal block device image file!
This file is the image at bml level of the XSR abstraction layer (see RFS page for more details).

At the bottom of this page there are also the bml image of LiMO param.lfs (from I6410BUJI3) and a plain image of the same content that you can use to try this code.

Note
The original samsung code is intended for a single J4FS instance at time, so I have put some code to prevent multiple image mounts to avoid file system corruptions.

Linux 3.1.x kernel compile instructions

# cd /usr/src/linux
# zcat [path to j4fs.patch.gz] | patch -p1
# make cloneconfig
# make prepare
# make -C /lib/modules/`uname -r`/build M=`pwd` fs/samsung/j4fs/j4fs.ko

The output of the last command should be something like:

make: Entering directory `/usr/src/linux-3.1.9-1.4-obj/x86_64/desktop'
  CC [M]  /usr/src/linux/fs/samsung/j4fs/j4fs_kernel.o
  CC [M]  /usr/src/linux/fs/samsung/j4fs/llid_kernel.o
  CC [M]  /usr/src/linux/fs/samsung/j4fs/fsd_common.o
  LD [M]  /usr/src/linux/fs/samsung/j4fs/j4fs.o
  MODPOST 1 modules
  CC      /usr/src/linux/fs/samsung/j4fs/j4fs.mod.o
  LD [M]  /usr/src/linux/fs/samsung/j4fs/j4fs.ko
make: Leaving directory `/usr/src/linux-3.1.9-1.4-obj/x86_64/desktop'

At this point you'll get the new module:

/usr/src/linux/fs/samsung/j4fs/j4fs.ko

Usage instructions

Simply load with:

# insmod /usr/src/linux/fs/samsung/j4fs/j4fs.ko

or install it system wide on your distro, so you can load it with a simple "modprobe j4fs".

Mount an image file via loopback device:

# mount -o loop test_j4fs /mnt

and now you should be able to access the content in /mnt...

If you try to mount another image without first of all unmount the other one, you will get this error:
mount: /dev/loop1 already mounted or mnt2 busy


Tested on:

openSUSE 12.1 (x86_64)

Linux droido 3.1.9-1.4-desktop #1 SMP PREEMPT Fri Jan 27 08:55:10 UTC 2012 (efb5ff4) x86_64 x86_64 x86_64 GNU/Linux


Donwload:

j4fs.patch.gz (24Kb) - J4FS "first 3.1.x kernel porting"
param.lfs.gz (341Kb) - Bml LiMO param image file
param.lfs.plain.gz (323Kb) - Plain J4FS filesystem image