10 May, 2011

1 commit

  • This replaces all references of NILFS_I_NILFS(inode)->ns_bdev with
    inode->i_sb->s_bdev and unfolds remaining uses of NILFS_I_NILFS inline
    function.

    Before 2.6.37, referring to a nilfs object from inodes needed a
    conditional judgement, and NILFS_I_NILFS was helpful to simplify it.
    But now we can simply do it by going through a super block instance
    like inode->i_sb->s_fs_info.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

09 Mar, 2011

1 commit

  • This directly uses sb->s_fs_info to keep a nilfs filesystem object and
    fully removes the intermediate nilfs_sb_info structure. With this
    change, the hierarchy of on-memory structures of nilfs will be
    simplified as follows:

    Before:
    super_block
    -> nilfs_sb_info
    -> the_nilfs
    -> cptree --+-> nilfs_root (current file system)
    +-> nilfs_root (snapshot A)
    +-> nilfs_root (snapshot B)
    :
    -> nilfs_sc_info (log writer structure)
    After:
    super_block
    -> the_nilfs
    -> cptree --+-> nilfs_root (current file system)
    +-> nilfs_root (snapshot A)
    +-> nilfs_root (snapshot B)
    :
    -> nilfs_sc_info (log writer structure)

    The reason why we didn't design so from the beginning is because the
    initial shape also differed from the above. The early hierachy was
    composed of "per-mount-point" super_block -> nilfs_sb_info pairs and a
    shared nilfs object. On the kernel 2.6.37, it was changed to the
    current shape in order to unify super block instances into one per
    device, and this cleanup became applicable as the result.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

08 Mar, 2011

1 commit

  • 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
     

10 Jan, 2011

2 commits

  • nilfs_dat_inode function was a wrapper to switch between normal dat
    inode and gcdat, a clone of the dat inode for garbage collection.

    This function got obsolete when the gcdat inode was removed, and now
    we can access the dat inode directly from a nilfs object. So, we will
    unfold the wrapper and remove it.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • Some functions using nilfs bmap routines can wrongly return invalid
    argument error (i.e. -EINVAL) that bmap returns as an internal code
    for btree corruption.

    This fixes the issue by catching and converting the internal EINVAL to
    EIO and calling nilfs_error function inside bmap routines.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

23 Oct, 2010

2 commits


23 Jul, 2010

1 commit


25 Dec, 2009

1 commit


20 Nov, 2009

2 commits

  • Previously, nilfs_bmap_add_blocks() and nilfs_bmap_sub_blocks() called
    mark_inode_dirty() after they changed the number of data blocks.

    This moves these calls outside bmap outermost functions like
    nilfs_bmap_insert() or nilfs_bmap_truncate().

    This will mitigate overhead for truncate or delete operation since
    they repeatedly remove set of blocks. Nearly 10 percent improvement
    was observed for removal of a large file:

    # dd if=/dev/zero of=/test/aaa bs=1M count=512
    # time rm /test/aaa

    real 2.968s -> 2.705s

    Further optimization may be possible by eliminating these
    mark_inode_dirty() uses though I avoid mixing separate changes here.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • Since metadata file routines mark the inode dirty after they
    successfully changed bmap objects, nilfs_mdt_mark_dirty() calls in
    nilfs_bmap_add_blocks() and nilfs_bmap_sub_blocks() are redundant.

    This removes these overlapping calls from the bmap routines.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

14 Sep, 2009

3 commits

  • The nilfs_bmap_lookup() is now a wrapper function of
    nilfs_bmap_lookup_at_level().

    This moves the nilfs_bmap_lookup() to a header file converting it to
    an inline function and gives an opportunity for optimization.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • The current btree code is written so that btree functions call dat
    operations via wrapper functions in bmap.c when they allocate, free,
    or modify virtual block addresses.

    This abstraction requires additional function calls and causes
    frequent call of nilfs_bmap_get_dat() function since it is used in the
    every wrapper function.

    This removes the wrapper functions and makes them available from
    btree.c and direct.c, which will increase the opportunity of
    compiler optimization.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • This is a preparation for the successive cleanup ("nilfs2: allow btree
    to directly call dat operations").

    This adds functions bundling a few operations to change an entry of
    virtual block address on the dat file.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

05 Jul, 2009

1 commit

  • This will fix the following false positive of recursive locking which
    lockdep has detected:

    =============================================
    [ INFO: possible recursive locking detected ]
    2.6.30-nilfs #42
    ---------------------------------------------
    nilfs_cleanerd/10607 is trying to acquire lock:
    (&bmap->b_sem){++++-.}, at: [] nilfs_bmap_lookup_at_level+0x1a/0x74 [nilfs2]

    but task is already holding lock:
    (&bmap->b_sem){++++-.}, at: [] nilfs_bmap_truncate+0x19/0x6a [nilfs2]
    other info that might help us debug this:
    2 locks held by nilfs_cleanerd/10607:
    #0: (&nilfs->ns_segctor_sem){++++.+}, at: [] nilfs_transaction_begin+0xb6/0x10c [nilfs2]
    #1: (&bmap->b_sem){++++-.}, at: [] nilfs_bmap_truncate+0x19/0x6a [nilfs2]

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

10 Jun, 2009

7 commits


13 Apr, 2009

1 commit

  • The bmap semaphore of DAT file can be held while a bmap of other files
    is locked. This has caused the following false detection of lockdep
    check:

    mount.nilfs2/4667 is trying to acquire lock:
    (&bmap->b_sem){..--}, at: [] nilfs_bmap_lookup_at_level+0x1a/0x74 [nilfs2]

    but task is already holding lock:
    (&bmap->b_sem){..--}, at: [] nilfs_bmap_lookup_at_level+0x1a/0x74 [nilfs2]

    This will fix the false detection by distinguishing semaphores of the
    DAT and other files.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

07 Apr, 2009

2 commits

  • This cleans up the strange indirect function calling convention used in
    nilfs to follow the normal kernel coding style.

    Signed-off-by: Pekka Enberg
    Acked-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pekka Enberg
     
  • This adds structures and operations for the block mapping (bmap for
    short). NILFS2 uses direct mappings for short files or B-tree based
    mappings for longer files.

    Every on-disk data block is held with inodes and managed through this
    block mapping. The nilfs_bmap structure and a set of functions here
    provide this capability to the NILFS2 inode.

    [penberg@cs.helsinki.fi: remove a bunch of bmap wrapper macros]
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: Koji Sato
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Pekka Enberg
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Koji Sato