Permalink
Commits on Nov 8, 2015
  1. nilfs2-kmod7 v1.1 release

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 8, 2015
  2. nilfs2: free unused dat file blocks during garbage collection

    As a nilfs2 volume ages, the amount of available disk space decreases
    little by little due to bloat of DAT (disk address translation) metadata
    file.  Even if we delete all files in a file system and free their block
    addresses from the DAT file through a garbage collection, empty DAT blocks
    are not freed.
    
    This fixes the issue by extending the deallocator of block addresses so
    that empty data blocks and empty bitmap blocks of DAT are deleted.
    
    The following comparison shows the effect of this patch.  Each shows disk
    amount information of a nilfs2 volume that we cleaned out by deleting all
    files and running gc after having filled 90% of its capacity.
    
    Before:
    Filesystem     1K-blocks     Used Available Use% Mounted on
    /dev/sda1      500105212  3022844 472072192   1% /test
    
    After:
    Filesystem     1K-blocks     Used Available Use% Mounted on
    /dev/sda1      500105212    16380 475078656   1% /test
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 7, 2015
  3. nilfs2: add helper functions to delete blocks from dat file

    This adds delete functions for data blocks of metadata files using bitmap
    based allocator.  nilfs_palloc_delete_entry_block() deletes an entry block
    (e.g.  block storing dat entries), and nilfs_palloc_delete_bitmap_block()
    deletes a bitmap block, respectively.
    
    These helpers are intended to be used in the successive change on
    deallocator of block addresses ("nilfs2: free unused dat file blocks
    during garbage collection").
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 7, 2015
  4. nilfs2: get rid of nilfs_palloc_group_is_in()

    This unfolds nilfs_palloc_group_is_in() helper function into
    nilfs_palloc_freev() function to simplify a range check and an index
    calculation repeatedy performed in a loop of the function.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 7, 2015
  5. nilfs2: refactor nilfs_palloc_find_available_slot()

    The current implementation of nilfs_palloc_find_available_slot() function
    is overkill.  The underlying bit search routine is well optimized, so this
    uses it more simply in nilfs_palloc_find_available_slot().
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 7, 2015
  6. nilfs2: do not call nilfs_mdt_bgl_lock() needlessly

    In the bitmap based allocator implementation, nilfs_mdt_bgl_lock() helper
    is frequently used to get a spinlock protecting a target block group.
    This reduces its usage and simplifies arguments of some related functions
    by directly passing a pointer to the spinlock.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 7, 2015
  7. nilfs2: use nilfs_warning() in allocator implementation

    This uses nilfs_warning() to replace "printk(KERN_WARNING ...);" in the
    bitmap based allocator implementation of nilfs2.  The warning messages are
    modified to include the device name and the inode number in each message.
    This makes it clear which metadata file of which device has output
    warnings such as "entry number xxxx already freed".
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Nov 7, 2015
Commits on Jul 6, 2015
  1. NILFS2: support NFSv2 export

    The "fh_len" passed to ->fh_to_* is not guaranteed to be that same as that
    returned by encode_fh - it may be larger.
    
    With NFSv2, the filehandle is fixed length, so it may appear longer than
    expected and be zero-padded.
    
    So we must test that fh_len is at least some value, not exactly equal to
    it.
    
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    neilbrown committed with konis Jun 25, 2015
Commits on Jun 7, 2015
  1. README: include vanilla kernel 3.6+ to supported versions

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  2. Only call file_update_time() in nilfs_page_mkwrite() for kernel 3.7+

    file_update_time() was moved out from __block_page_mkwrite() in kernel
    3.7.  nilfs_page_mkwrite() doesn't need to call it for kernel 3.6 and
    earlier.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  3. Set VM_CAN_NONLINIEAR to vm_flags in kernel 3.6 and earlier

    VM_CAN_NONLINEAR flag was removed in kernel 3.7.  This adds it for
    kernel 3.6 and earlier to support the earlier kernels.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  4. Fix build error due to addition of vm_ops->remap_pages()

    vm_ops->remap_pages() doesn't exist in kernel 3.6 and earlier.  This
    disables the remap_pages() operation to allow build on the earlier
    kernels.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  5. Fix build failure of nilfs_mapping_init() in kernel 3.7

    "assoc_mapping" member of address_space struct was replaced with a new
    member "private_data" in kernel 3.8.  This supports this change to
    allow build on kernel 3.7.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  6. Add FILEID_INVALID macro

    FILEID_INVALID macro doesn't exist in kernel 3.7 and earlier.  This
    adds it to allow build on the earlier kernels.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  7. Add compat function of wait_for_stable_page()

    wait_for_stable_page() function doesn't exist in kernel 3.8 and
    earlier.  This adds its compat function to allow build on the earlier
    kernels.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  8. Add mimic of MODULE_ALIAS_FS macro

    MODULE_ALIAS_FS macro doesn't exist in kernel 3.8 and earlier.  This
    adds a clone of the macro to allow build for the earlier kernels.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
  9. Add compat function of file_inode()

    Kernel 3.8 and earlier don't have file_inode() accessor and this
    hinders build of nilfs2-kmod on these kernels.  This adds a compat
    function of file_inode() to support build on them.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Jun 7, 2015
Commits on May 7, 2015
  1. nilfs2: fix sanity check of btree level in nilfs_btree_root_broken()

    The range check for b-tree level parameter in nilfs_btree_root_broken()
    is wrong; it accepts the case of "level == NILFS_BTREE_LEVEL_MAX" even
    though the level is limited to values in the range of 0 to
    (NILFS_BTREE_LEVEL_MAX - 1).
    
    Since the level parameter is read from storage device and used to index
    nilfs_btree_path array whose element count is NILFS_BTREE_LEVEL_MAX, it
    can cause memory overrun during btree operations if the boundary value
    is set to the level parameter on device.
    
    This fixes the broken sanity check and adds a comment to clarify that
    the upper bound NILFS_BTREE_LEVEL_MAX is exclusive.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed May 5, 2015
Commits on Apr 19, 2015
  1. nilfs2-kmod7 v1.0 release

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 18, 2015
  2. README: update versions of supported mainline kernel

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 19, 2015
  3. README: correct spell of CentOS

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 19, 2015
Commits on Apr 18, 2015
  1. nilfs2: improve execution time of NILFS_IOCTL_GET_CPINFO ioctl

    The older a filesystem gets, the slower lscp command becomes.  This is
    because nilfs_cpfile_do_get_cpinfo() function meets more hole blocks
    as the start offset of valid checkpoint numbers gets bigger.
    
    This reduces the overhead by skipping hole blocks efficiently with
    nilfs_mdt_find_block() helper.
    
    A measurement result of this patch is as follows:
    
    Before:
    $ time lscp
                     CNO        DATE     TIME  MODE  FLG      BLKCNT       ICNT
                 5769303  2015-02-22 19:31:33   cp    -          108          1
                 5769304  2015-02-22 19:38:54   cp    -          108          1
    
    real    0m0.182s
    user    0m0.003s
    sys     0m0.180s
    
    After:
    $ time lscp
                     CNO        DATE     TIME  MODE  FLG      BLKCNT       ICNT
                 5769303  2015-02-22 19:31:33   cp    -          108          1
                 5769304  2015-02-22 19:38:54   cp    -          108          1
    
    real    0m0.003s
    user    0m0.001s
    sys     0m0.002s
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 16, 2015
  2. nilfs2: add helper to find existent block on metadata file

    Add a new metadata file function, nilfs_mdt_find_block(), which finds
    an existent block on a metadata file in a given range of blocks.  This
    function skips continuous hole blocks efficiently by using
    nilfs_bmap_seek_key().
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 16, 2015
  3. nilfs2: add bmap function to seek a valid key

    Add a new bmap function, nilfs_bmap_seek_key(), which seeks a valid
    entry and returns its key starting from a given key.  This function
    can be used to skip hole blocks efficiently.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Cc: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 16, 2015
  4. nilfs2: unify type of key arguments in bmap interface

    The type of key arguments in block mapping interface varies depending
    on function.  For instance, nilfs_bmap_lookup_at_level() takes "__u64"
    for its key argument whereas nilfs_bmap_lookup() takes "unsigned
    long".
    
    This fits them to "__u64" to eliminate the variation.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 16, 2015
  5. nilfs2: use bgl_lock_ptr()

    Simplify nilfs_mdt_bgl_lock() by utilizing bgl_lock_ptr() helper in
    <linux/blockgroup_lock.h>.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 16, 2015
  6. nilfs2: use set_mask_bits() for operations on buffer state bitmap

    nilfs_forget_buffer(), nilfs_clear_dirty_page(), and
    nilfs_segctor_complete_write() are using a bunch of atomic bit operations
    against buffer state bitmap.
    
    This reduces the number of them by utilizing set_mask_bits() macro.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    [segment.c: add reference to kern_feature.h to use set_mask_bits()]
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 16, 2015
  7. Add mimic of set_mask_bits() helper for old kernels

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 18, 2015
  8. nilfs2: do not use async write flag for segment summary buffers

    The async write flag is introduced to nilfs2 in the commit 7f42ec394156
    ("nilfs2: fix issue with race condition of competition between segments
    for dirty blocks"), but the flag only makes sense for data buffers and
    btree node buffers.  It is not needed for segment summary buffers.
    
    This gets rid of the latter uses as part of refactoring of atomic bit
    operations on buffer state bitmap.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 16, 2015
  9. nilfs2: use inode_set_flags() in nilfs_set_inode_flags()

    Use inode_set_flags() to atomically set i_flags instead of clearing out
    the S_IMMUTABLE, S_APPEND, etc.  flags and then setting them from the
    FS_IMMUTABLE_FL, FS_APPEND_FL flags to avoid a race where an immutable
    file has the immutable flag cleared for a brief window of time.
    
    This is a similar fix to commit 5f16f3225b06 ("ext4: atomically set
    inode->i_flags in ext4_set_inode_flags()").
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Cc: "Theodore Ts'o" <tytso@mit.edu>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 16, 2015
  10. Add mimic of inode_set_flags() for old kernels

    inode_set_flags() is used to atomically set inode->i_flags.
    This adds the function as an inline to make it available
    in kernel 3.15 and earlier.
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 17, 2015
  11. nilfs2: put out gfp mask manipulation from nilfs_set_inode_flags()

    nilfs_set_inode_flags() function adjusts gfp-mask of inode->i_mapping as
    well as i_flags, however, this coupling of operations is not appropriate.
    
    For instance, nilfs_ioctl_setflags(), one of three callers of
    nilfs_set_inode_flags(), doesn't need to reinitialize the gfp-mask at all.
     In addition, nilfs_new_inode(), another caller of
    nilfs_set_inode_flags(), doesn't either because it has already initialized
    the gfp-mask.
    
    Only __nilfs_read_inode(), the remaining caller, needs it.  So, this moves
    the gfp mask manipulation to __nilfs_read_inode() from
    nilfs_set_inode_flags().
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 16, 2015
  12. nilfs2: fix gcc warning at nilfs_checkpoint_is_mounted()

    Fix the following build warning:
    
     fs/nilfs2/super.c: In function 'nilfs_checkpoint_is_mounted':
     fs/nilfs2/super.c:1023:10: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
       if (cno < 0 || cno > nilfs->ns_cno)
               ^
    
    This warning indicates that the comparision "cno < 0" is useless because
    variable "cno" has an unsigned integer type "__u64".
    
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    Reported-by: David Binderman <dcb314@hotmail.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 16, 2015
  13. Fix build error due to removal of mapping->backing_dev_info

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 18, 2015
  14. Fix build error due to removal of vm_ops->remap_pages()

    Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
    konis committed Apr 18, 2015