diff options
author | Tao Ma <tao.ma@oracle.com> | 2009-08-17 23:19:29 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2009-09-22 23:09:27 -0400 |
commit | a433848132d8cdfb8173745b922ddb919de11527 (patch) | |
tree | b12db738743e4eb4a7222996300fa468b1dc39e5 /fs/ocfs2 | |
parent | f2c870e3b12e38da6d9b5b17c4c8ae56a0ed68e4 (diff) |
ocfs2: Abstract caching info checkpoint.
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>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/dlmglue.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index f518d1bee30a..79db0557df88 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
@@ -3495,11 +3495,11 @@ out: | |||
3495 | return UNBLOCK_CONTINUE; | 3495 | return UNBLOCK_CONTINUE; |
3496 | } | 3496 | } |
3497 | 3497 | ||
3498 | static int ocfs2_check_meta_downconvert(struct ocfs2_lock_res *lockres, | 3498 | static int ocfs2_ci_checkpointed(struct ocfs2_caching_info *ci, |
3499 | int new_level) | 3499 | struct ocfs2_lock_res *lockres, |
3500 | int new_level) | ||
3500 | { | 3501 | { |
3501 | struct inode *inode = ocfs2_lock_res_inode(lockres); | 3502 | int checkpointed = ocfs2_ci_fully_checkpointed(ci); |
3502 | int checkpointed = ocfs2_ci_fully_checkpointed(INODE_CACHE(inode)); | ||
3503 | 3503 | ||
3504 | BUG_ON(new_level != DLM_LOCK_NL && new_level != DLM_LOCK_PR); | 3504 | BUG_ON(new_level != DLM_LOCK_NL && new_level != DLM_LOCK_PR); |
3505 | BUG_ON(lockres->l_level != DLM_LOCK_EX && !checkpointed); | 3505 | BUG_ON(lockres->l_level != DLM_LOCK_EX && !checkpointed); |
@@ -3507,10 +3507,18 @@ static int ocfs2_check_meta_downconvert(struct ocfs2_lock_res *lockres, | |||
3507 | if (checkpointed) | 3507 | if (checkpointed) |
3508 | return 1; | 3508 | return 1; |
3509 | 3509 | ||
3510 | ocfs2_start_checkpoint(OCFS2_SB(inode->i_sb)); | 3510 | ocfs2_start_checkpoint(OCFS2_SB(ocfs2_metadata_cache_get_super(ci))); |
3511 | return 0; | 3511 | return 0; |
3512 | } | 3512 | } |
3513 | 3513 | ||
3514 | static int ocfs2_check_meta_downconvert(struct ocfs2_lock_res *lockres, | ||
3515 | int new_level) | ||
3516 | { | ||
3517 | struct inode *inode = ocfs2_lock_res_inode(lockres); | ||
3518 | |||
3519 | return ocfs2_ci_checkpointed(INODE_CACHE(inode), lockres, new_level); | ||
3520 | } | ||
3521 | |||
3514 | static void ocfs2_set_meta_lvb(struct ocfs2_lock_res *lockres) | 3522 | static void ocfs2_set_meta_lvb(struct ocfs2_lock_res *lockres) |
3515 | { | 3523 | { |
3516 | struct inode *inode = ocfs2_lock_res_inode(lockres); | 3524 | struct inode *inode = ocfs2_lock_res_inode(lockres); |