10 May, 2011

2 commits

  • This adds a new ioctl command which limits range of segment to be
    allocated. This is intended to gather data whithin a range of the
    partition before shrinking the filesystem, or to control new log
    location for some purpose.

    If a range is specified by the ioctl, segment allocator of nilfs tries
    to allocate new segments from the range unless no free segments are
    available there.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • The size of super root structure depends on inode size, so
    NILFS_SR_BYTES macro should be a function of the inode size. This
    fixes the issue.

    Even though a different size value will be written for a possible
    future filesystem with extended inode, but fortunately this does not
    break disk format compatibility.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

10 Mar, 2011

1 commit


08 Mar, 2011

3 commits

  • This records the number of used blocks per checkpoint in each
    checkpoint entry of cpfile. Even though userland tools can get the
    block count via nilfs_get_cpinfo ioctl, it was not updated by the
    nilfs2 kernel code. This fixes the issue and makes it available for
    userland tools to calculate used amount per checkpoint.

    Signed-off-by: Ryusuke Konishi
    Cc: Jiro SEKIBA

    Ryusuke Konishi
     
  • This is a similar change to those in ext2/ext3 codebase (commit
    40a063f6691ce937 and a4ae3094869f18e2, respectively).

    The addition of 64k block capability in the rec_len_from_disk and
    rec_len_to_disk functions added a bit of math overhead which slows
    down file create workloads needlessly when the architecture cannot
    even support 64k blocks. This will cut the corner.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • Replaces uses of own inode flags (i.e. NILFS_SECRM_FL, NILFS_UNRM_FL,
    NILFS_COMPR_FL, and so forth) with common inode flags, and removes the
    own flag declarations.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

23 Oct, 2010

4 commits

  • This allows other projects to carry copies of the header file related
    to ABI and disk format (i.e. "nilfs2_fs.h") without it or distributors
    having to worry about effects on the project's overall license terms.
    It's also desired for switching the license of nilfs library to LGPL.

    Jiro SEKIBA pointed out these license issues (Message-ID:
    ), and he suggested switching license of
    the library and nilfs2_fs.h to GNU Lesser General Public License. We
    take in his suggestion to avoid the license issues.

    Signed-off-by: Ryusuke Konishi
    Cc: Jiro SEKIBA
    Cc: linux-nilfs

    Ryusuke Konishi
     
  • This flag is a fake used to distinguish type of super block instance.
    And, it got obsolete by the unification of sb.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • On-memory inode structures of nilfs have a member "i_cno" which stores
    a checkpoint number related to the inode. For gc-inodes, this field
    indicates version of data each gc-inode caches for GC. Log writer
    temporarily uses "i_cno" to transfer the latest checkpoint number.

    This stops the latter use and lets only gc-inodes use it.

    The purpose of this patch is to allow the successive change use
    "i_cno" for inode lookup.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • Compatibility of nilfs partitions is now managed with three feature
    sets. This changes old compatibility check with revision number so
    that it can accept future revisions.

    Note that we can stop support of experimental versions of nilfs that
    doesn't know the feature sets by incrementing NILFS_CURRENT_REV. We
    don't have to do it soon, but it would be a possible option whenever
    the need arises.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

25 Jul, 2010

2 commits

  • This inserts sanity check that refuses to mount a filesystem with
    unsupported block size.

    Previously, kernel code of nilfs was looking only limitation of
    devices though mkfs.nilfs2 limits the range of block sizes; there was
    no check that prevents rec_len overflow with larger block sizes.

    With this change, block sizes larger than 64KB or smaller than 1KB
    will get rejected explicitly by kernel.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • With 64KB blocksize, a directory entry can have size 64KB which does
    not fit into 16 bits we have for entry length. So this patch stores
    0xffff instead and converts value when read from / written to disk.

    Nilfs derives its directory implementation from ext2 filesystem, and
    this draws upon the corresponding change on ext2.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

23 Jul, 2010

2 commits

  • This adds three new fields to nilfs_super_block structure, compatible
    feature set, readonly-compatible feature set, and incompatible feature
    set in order to prepare for future disk format modifications.

    The role of these fields conforms to those of ext3 or other
    filesystems. Most important flags are the incompatible feature set;
    it is used to refuse to mount the filesystem which sets an
    incompatible feature the kernel doesn't know about.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • This inserts comments indicating hexadecimal offset in declaration of
    nilfs_super_block structure so that people can know offset of its
    fields without counting from the head.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

10 May, 2010

4 commits

  • Current s_volume_name has 16 bytes, which is too small as modern filesystem.

    s_last_mounted resides just after s_volume_name and has 64 bytes.

    s_last_mounted is historically came from ext2, but not used in nilfs2 at all.
    Deleting s_last_mounted member and merging that space with s_volume_name
    enlarge s_volume_name upto 80 bytes for volume label.

    When user land tools see the old header for new disk, it will just ignore
    additional bytes stored in s_last_mounted. While, old disk format has only
    16 bytes label, it doesn't affects in case seeing the new header for old disk.

    Signed-off-by: Jiro SEKIBA
    Signed-off-by: Ryusuke Konishi

    Jiro SEKIBA
     
  • This adds a field to record the latest checkpoint number in the
    nilfs_segment_summary structure. This will help to recover the latest
    checkpoint number from logs on disk. This field is intended for
    crucial cases in which super blocks have lost pointer to the latest
    log.

    Even though this will change the disk format, both backward and
    forward compatibility is preserved by a size field prepared in the
    segment summary header.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • This kills the following checkpatch warnings:

    WARNING: please, no space before tabs
    +^I__le32^Is_first_ino; ^I^I/* First non-reserved inode */$

    WARNING: please, no space before tabs
    +^I__le16 s_inode_size; ^I^I/* Size of an inode */$

    WARNING: please, no space before tabs
    +^Ichar^Is_volume_name[16]; ^I/* volume name */$

    WARNING: please, no space before tabs
    +^Ichar^Is_last_mounted[64]; ^I/* directory where last mounted */$

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • The comment of struct nilfs_dat_entry is mismatched, fix it.

    Signed-off-by: Qinghuang Feng
    Signed-off-by: Ryusuke Konishi

    Qinghuang Feng
     

13 Feb, 2010

1 commit


20 Nov, 2009

2 commits

  • This adds "norecovery" mount option which disables temporal write
    access to read-only mounts or snapshots during mount/recovery.
    Without this option, write access will be even performed for those
    types of mounts; the temporal write access is needed to mount root
    file system read-only after an unclean shutdown.

    This option will be helpful when user wants to prevent any write
    access to the device.

    Signed-off-by: Ryusuke Konishi
    Cc: Eric Sandeen

    Ryusuke Konishi
     
  • This is a trivial patch to expose struct nilfs_fs_btree_node.
    The struct should be exposed outside of kernel, for it is disk format.

    Signed-off-by: Jiro SEKIBA
    Signed-off-by: Ryusuke Konishi

    Jiro SEKIBA
     

15 Nov, 2009

1 commit


07 Apr, 2009

9 commits

  • After a review of user's feedback for finding out other compatibility
    issues, I found nilfs improperly initializes timestamps in inode;
    CURRENT_TIME was used there instead of CURRENT_TIME_SEC even though nilfs
    didn't have nanosecond timestamps on disk. A few users gave us the report
    that the tar program sometimes failed to expand symbolic links on nilfs,
    and it turned out to be the cause.

    Instead of applying the above displacement, I've decided to support
    nanosecond timestamps on this occation. Fortunetaly, a needless 64-bit
    field was in the nilfs_inode struct, and I found it's available for this
    purpose without impact for the users.

    So, this will do the enhancement and resolve the tar problem.

    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • The former versions didn't have extra super blocks. This improves the
    weak point by introducing another super block at unused region in tail of
    the partition.

    This doesn't break disk format compatibility; older versions just ingore
    the secondary super block, and new versions just recover it if it doesn't
    exist. The partition created by an old mkfs may not have unused region,
    but in that case, the secondary super block will not be added.

    This doesn't make more redundant copies of the super block; it is a future
    work.

    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • Nilfs creates checkpoints even for garbage collection or metadata updates
    such as checkpoint mode change. So, user often sees checkpoints created
    only by such internal operations.

    This is inconvenient in some situations. For example, application that
    monitors checkpoints and changes them to snapshots, will fall into an
    infinite loop because it cannot distinguish internally created
    checkpoints.

    This patch solves this sort of problem by adding a flag to checkpoint for
    identification.

    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • The sketch file is a file to mark checkpoints with user data. It was
    experimentally introduced in the original implementation, and now
    obsolete. The file was handled differently with regular files; the file
    size got truncated when a checkpoint was created.

    This stops the special treatment and will treat it as a regular file.
    Most users are not affected because mkfs.nilfs2 no longer makes this file.

    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • This adds a new argument to the nilfs_sustat structure.

    The extended field allows to delete volatile active state of segments,
    which was needed to protect freshly-created segments from garbage
    collection but has confused code dealing with segments. This
    extension alleviates the mess and gives room for further
    simplifications.

    The volatile active flag is not persistent, so it's eliminable on this
    occasion without affecting compatibility other than the ioctl change.

    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • This removes compat code from the nilfs ioctls and applies the same
    function for both .ioctl and .compat_ioctl file operations.

    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • Nilfs ioctl had structures not having fixed sized types such as:

    struct nilfs_argv {
    void *v_base;
    size_t v_nmembs;
    size_t v_size;
    int v_index;
    int v_flags;
    };

    Further, some of them are wrongly aligned:

    e.g.

    struct nilfs_cpmode {
    __u64 cm_cno;
    int cm_mode;
    };

    The size of wrongly aligned structures varies depending on
    architectures, and it breaks the identity of ioctl commands, which
    leads to arch dependent errors.

    Previously, these are compensated by using compat_ioctl.

    This fixes these problems and allows removal of compat ioctl.

    Since this will change sizes of those structures, binary compatibility
    for the past utilities will once break; new utilities have to be used
    instead. However, it would be helpful to avoid platform dependent
    problems in the long term.

    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • This removes NILFS_IOCTL_TIMEDWAIT command from ioctl interface along
    with the related flags and wait queue.

    The command is terrible because it just sleeps in the ioctl. I prefer
    to avoid this by devising means of event polling in userland program.
    By reconsidering the userland GC daemon, I found this is possible
    without changing behaviour of the daemon and sacrificing efficiency.

    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • This adds a header file which specifies the on-disk format and ioctl
    interface of the nilfs2 file system.

    Signed-off-by: Koji Sato
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Koji Sato