[PATCH 5/7] nilfs2: get rid of nilfs_palloc_group_is_in()

2015-09-19 Thread Ryusuke Konishi
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 --- fs/nilfs2/alloc.c | 28 +--- 1 file changed, 9 i

[PATCH 1/7] nilfs2: drop null test before destroy functions

2015-09-19 Thread Ryusuke Konishi
From: Julia Lawall Remove unneeded NULL test. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ -if (x != NULL) \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x); // Signed-off-by: Julia Lawall Signed-off-by: Ryusuke Ko

[PATCH 3/7] nilfs2: do not call nilfs_mdt_bgl_lock() needlessly

2015-09-19 Thread Ryusuke Konishi
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

[PATCH 6/7] nilfs2: add helper functions to delete blocks from dat file

2015-09-19 Thread Ryusuke Konishi
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

[PATCH 7/7] nilfs2: free unused dat file blocks during garbage collection

2015-09-19 Thread Ryusuke Konishi
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

[PATCH 4/7] nilfs2: refactor nilfs_palloc_find_available_slot()

2015-09-19 Thread Ryusuke Konishi
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 --- fs/nilfs2/alloc.c | 48 +-

[PATCH 2/7] nilfs2: use nilfs_warning() in allocator implementation

2015-09-19 Thread Ryusuke Konishi
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 s

[PATCH 0/7] nilfs2 updates

2015-09-19 Thread Ryusuke Konishi
Hi Andrew, Please queue the following changes for the next merge window: Julia Lawall (1): nilfs2: drop null test before destroy functions Ryusuke Konishi (6): nilfs2: use nilfs_warning() in allocator implementation nilfs2: do not call nilfs_mdt_bgl_lock() needlessly nilf