mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
nilfs2: support contiguous lookup of blocks
Although get_block() callback function can return extent of contiguous blocks with bh->b_size, nilfs_get_block() function did not support this feature. This adds contiguous lookup feature to the block mapping codes of nilfs, and allows the nilfs_get_blocks() function to return the extent information by applying the feature. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
This commit is contained in:
parent
fa032744ad
commit
c3a7abf06c
5 changed files with 150 additions and 8 deletions
|
@ -31,7 +31,7 @@
|
|||
#include "dat.h"
|
||||
#include "alloc.h"
|
||||
|
||||
static struct inode *nilfs_bmap_get_dat(const struct nilfs_bmap *bmap)
|
||||
struct inode *nilfs_bmap_get_dat(const struct nilfs_bmap *bmap)
|
||||
{
|
||||
return nilfs_dat_inode(NILFS_I_NILFS(bmap->b_inode));
|
||||
}
|
||||
|
@ -58,6 +58,16 @@ int nilfs_bmap_lookup_at_level(struct nilfs_bmap *bmap, __u64 key, int level,
|
|||
return ret;
|
||||
}
|
||||
|
||||
int nilfs_bmap_lookup_contig(struct nilfs_bmap *bmap, __u64 key, __u64 *ptrp,
|
||||
unsigned maxblocks)
|
||||
{
|
||||
int ret;
|
||||
|
||||
down_read(&bmap->b_sem);
|
||||
ret = bmap->b_ops->bop_lookup_contig(bmap, key, ptrp, maxblocks);
|
||||
up_read(&bmap->b_sem);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* nilfs_bmap_lookup - find a record
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue