Skip to content

Commit

Permalink
ocfs2: temporarily remove extent map caching
Browse files Browse the repository at this point in the history
The code in extent_map.c is not prepared to deal with a subtree being
rotated between lookups. This can happen when filling holes in sparse files.
Instead of a lengthy patch to update the code (which would likely lose the
benefit of caching subtree roots), we remove most of the algorithms and
implement a simple path based lookup. A less ambitious extent caching scheme
will be added in a later patch.

Signed-off-by: Mark Fasheh <[email protected]>
  • Loading branch information
Mark Fasheh committed Apr 26, 2007
1 parent dcd0538 commit 363041a
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 996 deletions.
5 changes: 2 additions & 3 deletions fs/ocfs2/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1146,9 +1146,8 @@ static void find_leaf_ins(void *data, struct buffer_head *bh)
*
* This function doesn't handle non btree extent lists.
*/
static int ocfs2_find_leaf(struct inode *inode,
struct ocfs2_extent_list *root_el, u32 cpos,
struct buffer_head **leaf_bh)
int ocfs2_find_leaf(struct inode *inode, struct ocfs2_extent_list *root_el,
u32 cpos, struct buffer_head **leaf_bh)
{
int ret;
struct buffer_head *bh = NULL;
Expand Down
3 changes: 3 additions & 0 deletions fs/ocfs2/alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,
struct buffer_head *fe_bh,
struct ocfs2_truncate_context *tc);

int ocfs2_find_leaf(struct inode *inode, struct ocfs2_extent_list *root_el,
u32 cpos, struct buffer_head **leaf_bh);

#endif /* OCFS2_ALLOC_H */
8 changes: 3 additions & 5 deletions fs/ocfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ static int ocfs2_get_block(struct inode *inode, sector_t iblock,
if (err)
goto bail;

err = ocfs2_extent_map_get_blocks(inode, iblock, 1, &p_blkno,
NULL);
err = ocfs2_extent_map_get_blocks(inode, iblock, &p_blkno, NULL);
if (err) {
mlog(ML_ERROR, "Error %d from get_blocks(0x%p, %llu, 1, "
"%llu, NULL)\n", err, inode, (unsigned long long)iblock,
Expand Down Expand Up @@ -499,8 +498,7 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block)
down_read(&OCFS2_I(inode)->ip_alloc_sem);
}

err = ocfs2_extent_map_get_blocks(inode, block, 1, &p_blkno,
NULL);
err = ocfs2_extent_map_get_blocks(inode, block, &p_blkno, NULL);

if (!INODE_JOURNAL(inode)) {
up_read(&OCFS2_I(inode)->ip_alloc_sem);
Expand Down Expand Up @@ -574,7 +572,7 @@ static int ocfs2_direct_IO_get_blocks(struct inode *inode, sector_t iblock,

/* This figures out the size of the next contiguous block, and
* our logical offset */
ret = ocfs2_extent_map_get_blocks(inode, iblock, 1, &p_blkno,
ret = ocfs2_extent_map_get_blocks(inode, iblock, &p_blkno,
&contig_blocks);
if (ret) {
mlog(ML_ERROR, "get_blocks() failed iblock=%llu\n",
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ int ocfs2_do_extend_dir(struct super_block *sb,

status = ocfs2_extent_map_get_blocks(dir, (dir->i_blocks >>
(sb->s_blocksize_bits - 9)),
1, &p_blkno, NULL);
&p_blkno, NULL);
if (status < 0) {
mlog_errno(status);
goto bail;
Expand Down
4 changes: 0 additions & 4 deletions fs/ocfs2/dlmglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -1614,10 +1614,6 @@ static int ocfs2_meta_lock_update(struct inode *inode,
* for the inode metadata. */
ocfs2_metadata_cache_purge(inode);

/* will do nothing for inode types that don't use the extent
* map (bitmap files, etc) */
ocfs2_extent_map_trunc(inode, 0);

if (ocfs2_meta_lvb_is_trustable(inode, lockres)) {
mlog(0, "Trusting LVB on inode %llu\n",
(unsigned long long)oi->ip_blkno);
Expand Down
Loading

0 comments on commit 363041a

Please sign in to comment.