Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114372
b: refs/heads/master
c: ac11c82
h: refs/heads/master
v: v3
  • Loading branch information
Tao Ma authored and Mark Fasheh committed Oct 13, 2008
1 parent b24bac1 commit 3aca5bb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5a7bc8eb29b8c759df374d97b6189e03d4ea71c5
refs/heads/master: ac11c827192272eabb68b8f4cf844066461d9690
32 changes: 26 additions & 6 deletions trunk/fs/ocfs2/uptodate.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,14 +511,10 @@ static void ocfs2_remove_metadata_tree(struct ocfs2_caching_info *ci,
ci->ci_num_cached--;
}

/* Called when we remove a chunk of metadata from an inode. We don't
* bother reverting things to an inlined array in the case of a remove
* which moves us back under the limit. */
void ocfs2_remove_from_cache(struct inode *inode,
struct buffer_head *bh)
static void ocfs2_remove_block_from_cache(struct inode *inode,
sector_t block)
{
int index;
sector_t block = bh->b_blocknr;
struct ocfs2_meta_cache_item *item = NULL;
struct ocfs2_inode_info *oi = OCFS2_I(inode);
struct ocfs2_caching_info *ci = &oi->ip_metadata_cache;
Expand All @@ -544,6 +540,30 @@ void ocfs2_remove_from_cache(struct inode *inode,
kmem_cache_free(ocfs2_uptodate_cachep, item);
}

/*
* Called when we remove a chunk of metadata from an inode. We don't
* bother reverting things to an inlined array in the case of a remove
* which moves us back under the limit.
*/
void ocfs2_remove_from_cache(struct inode *inode,
struct buffer_head *bh)
{
sector_t block = bh->b_blocknr;

ocfs2_remove_block_from_cache(inode, block);
}

/* Called when we remove xattr clusters from an inode. */
void ocfs2_remove_xattr_clusters_from_cache(struct inode *inode,
sector_t block,
u32 c_len)
{
u64 i, b_len = ocfs2_clusters_to_blocks(inode->i_sb, 1) * c_len;

for (i = 0; i < b_len; i++, block++)
ocfs2_remove_block_from_cache(inode, block);
}

int __init init_ocfs2_uptodate_cache(void)
{
ocfs2_uptodate_cachep = kmem_cache_create("ocfs2_uptodate",
Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/ocfs2/uptodate.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ void ocfs2_set_new_buffer_uptodate(struct inode *inode,
struct buffer_head *bh);
void ocfs2_remove_from_cache(struct inode *inode,
struct buffer_head *bh);
void ocfs2_remove_xattr_clusters_from_cache(struct inode *inode,
sector_t block,
u32 c_len);
int ocfs2_buffer_read_ahead(struct inode *inode,
struct buffer_head *bh);

Expand Down

0 comments on commit 3aca5bb

Please sign in to comment.