diff options
author | Tao Ma <tao.ma@oracle.com> | 2009-08-17 23:44:14 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2009-09-22 23:09:48 -0400 |
commit | bc13d347574fc0a8a666bc0f4cc2b635d202e372 (patch) | |
tree | 47eb9a764d3689ddd860d96f6cd80cf26a84bcc2 /fs/ocfs2/namei.h | |
parent | 19bd341f6a6c6b314bcac55bbd906bfd3603fe9e (diff) |
ocfs2: Create reflinked file in orphan dir.
reflink is a very complicated process, so it can't be integrated
into one transaction. So if the system panic in the operation, we
may leave a unfinished inode in the destication directory.
So we will try to create an inode in orphan_dir first, reflink it
to the src file and then move it to the destication file in the end.
In that way we won't be afraid of any corruption during the reflink.
This patch adds 2 functions for orphan_dir operation:
1. Create a new inode in orphand dir.
2. Move an inode to a target dir.
Note:
fsck.ocfs2 should work for us to remove the unfinished file in the
orphan_dir.
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Diffstat (limited to 'fs/ocfs2/namei.h')
-rw-r--r-- | fs/ocfs2/namei.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ocfs2/namei.h b/fs/ocfs2/namei.h index 688aef64c879..e5d059d4f115 100644 --- a/fs/ocfs2/namei.h +++ b/fs/ocfs2/namei.h | |||
@@ -35,5 +35,11 @@ int ocfs2_orphan_del(struct ocfs2_super *osb, | |||
35 | struct inode *orphan_dir_inode, | 35 | struct inode *orphan_dir_inode, |
36 | struct inode *inode, | 36 | struct inode *inode, |
37 | struct buffer_head *orphan_dir_bh); | 37 | struct buffer_head *orphan_dir_bh); |
38 | int ocfs2_create_inode_in_orphan(struct inode *dir, | ||
39 | int mode, | ||
40 | struct inode **new_inode); | ||
41 | int ocfs2_mv_orphaned_inode_to_new(struct inode *dir, | ||
42 | struct inode *new_inode, | ||
43 | struct dentry *new_dentry); | ||
38 | 44 | ||
39 | #endif /* OCFS2_NAMEI_H */ | 45 | #endif /* OCFS2_NAMEI_H */ |