Skip to content

Commit

Permalink
ocfs2: Abstract caching info checkpoint.
Browse files Browse the repository at this point in the history
In meta downconvert, we need to checkpoint the metadata in an inode.
For refcount tree, we also need it. So abstract the process out.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
  • Loading branch information
Tao Ma authored and Joel Becker committed Sep 23, 2009
1 parent f2c870e commit a433848
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions fs/ocfs2/dlmglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -3495,22 +3495,30 @@ static int ocfs2_data_convert_worker(struct ocfs2_lock_res *lockres,
return UNBLOCK_CONTINUE;
}

static int ocfs2_check_meta_downconvert(struct ocfs2_lock_res *lockres,
int new_level)
static int ocfs2_ci_checkpointed(struct ocfs2_caching_info *ci,
struct ocfs2_lock_res *lockres,
int new_level)
{
struct inode *inode = ocfs2_lock_res_inode(lockres);
int checkpointed = ocfs2_ci_fully_checkpointed(INODE_CACHE(inode));
int checkpointed = ocfs2_ci_fully_checkpointed(ci);

BUG_ON(new_level != DLM_LOCK_NL && new_level != DLM_LOCK_PR);
BUG_ON(lockres->l_level != DLM_LOCK_EX && !checkpointed);

if (checkpointed)
return 1;

ocfs2_start_checkpoint(OCFS2_SB(inode->i_sb));
ocfs2_start_checkpoint(OCFS2_SB(ocfs2_metadata_cache_get_super(ci)));
return 0;
}

static int ocfs2_check_meta_downconvert(struct ocfs2_lock_res *lockres,
int new_level)
{
struct inode *inode = ocfs2_lock_res_inode(lockres);

return ocfs2_ci_checkpointed(INODE_CACHE(inode), lockres, new_level);
}

static void ocfs2_set_meta_lvb(struct ocfs2_lock_res *lockres)
{
struct inode *inode = ocfs2_lock_res_inode(lockres);
Expand Down

0 comments on commit a433848

Please sign in to comment.