diff options
author | Joel Becker <joel.becker@oracle.com> | 2010-04-30 16:37:29 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-04-30 16:37:29 -0400 |
commit | f9221fd80343285514568da6c5dbda0f87109de8 (patch) | |
tree | 3a2f0077ebea9d094bdeedb319c97cb591d51c51 /fs/ocfs2/inode.c | |
parent | a36d515c7a2dfacebcf41729f6812dbc424ebcf0 (diff) | |
parent | a9743fcdc0eb43d028b71267438076e1b0112ba0 (diff) |
Merge branch 'skip_delete_inode' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2-mark into ocfs2-fixes
Diffstat (limited to 'fs/ocfs2/inode.c')
-rw-r--r-- | fs/ocfs2/inode.c | 66 |
1 files changed, 36 insertions, 30 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 23c254e26018..83fe1d38f5cb 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c | |||
@@ -25,7 +25,6 @@ | |||
25 | 25 | ||
26 | #include <linux/fs.h> | 26 | #include <linux/fs.h> |
27 | #include <linux/types.h> | 27 | #include <linux/types.h> |
28 | #include <linux/slab.h> | ||
29 | #include <linux/highmem.h> | 28 | #include <linux/highmem.h> |
30 | #include <linux/pagemap.h> | 29 | #include <linux/pagemap.h> |
31 | #include <linux/quotaops.h> | 30 | #include <linux/quotaops.h> |
@@ -641,11 +640,13 @@ static int ocfs2_remove_inode(struct inode *inode, | |||
641 | goto bail_unlock; | 640 | goto bail_unlock; |
642 | } | 641 | } |
643 | 642 | ||
644 | status = ocfs2_orphan_del(osb, handle, orphan_dir_inode, inode, | 643 | if (!(OCFS2_I(inode)->ip_flags & OCFS2_INODE_SKIP_ORPHAN_DIR)) { |
645 | orphan_dir_bh); | 644 | status = ocfs2_orphan_del(osb, handle, orphan_dir_inode, inode, |
646 | if (status < 0) { | 645 | orphan_dir_bh); |
647 | mlog_errno(status); | 646 | if (status < 0) { |
648 | goto bail_commit; | 647 | mlog_errno(status); |
648 | goto bail_commit; | ||
649 | } | ||
649 | } | 650 | } |
650 | 651 | ||
651 | /* set the inodes dtime */ | 652 | /* set the inodes dtime */ |
@@ -728,34 +729,35 @@ static int ocfs2_wipe_inode(struct inode *inode, | |||
728 | struct inode *orphan_dir_inode = NULL; | 729 | struct inode *orphan_dir_inode = NULL; |
729 | struct buffer_head *orphan_dir_bh = NULL; | 730 | struct buffer_head *orphan_dir_bh = NULL; |
730 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 731 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
731 | struct ocfs2_dinode *di; | 732 | struct ocfs2_dinode *di = (struct ocfs2_dinode *) di_bh->b_data; |
732 | 733 | ||
733 | di = (struct ocfs2_dinode *) di_bh->b_data; | 734 | if (!(OCFS2_I(inode)->ip_flags & OCFS2_INODE_SKIP_ORPHAN_DIR)) { |
734 | orphaned_slot = le16_to_cpu(di->i_orphaned_slot); | 735 | orphaned_slot = le16_to_cpu(di->i_orphaned_slot); |
735 | 736 | ||
736 | status = ocfs2_check_orphan_recovery_state(osb, orphaned_slot); | 737 | status = ocfs2_check_orphan_recovery_state(osb, orphaned_slot); |
737 | if (status) | 738 | if (status) |
738 | return status; | 739 | return status; |
739 | 740 | ||
740 | orphan_dir_inode = ocfs2_get_system_file_inode(osb, | 741 | orphan_dir_inode = ocfs2_get_system_file_inode(osb, |
741 | ORPHAN_DIR_SYSTEM_INODE, | 742 | ORPHAN_DIR_SYSTEM_INODE, |
742 | orphaned_slot); | 743 | orphaned_slot); |
743 | if (!orphan_dir_inode) { | 744 | if (!orphan_dir_inode) { |
744 | status = -EEXIST; | 745 | status = -EEXIST; |
745 | mlog_errno(status); | 746 | mlog_errno(status); |
746 | goto bail; | 747 | goto bail; |
747 | } | 748 | } |
748 | 749 | ||
749 | /* Lock the orphan dir. The lock will be held for the entire | 750 | /* Lock the orphan dir. The lock will be held for the entire |
750 | * delete_inode operation. We do this now to avoid races with | 751 | * delete_inode operation. We do this now to avoid races with |
751 | * recovery completion on other nodes. */ | 752 | * recovery completion on other nodes. */ |
752 | mutex_lock(&orphan_dir_inode->i_mutex); | 753 | mutex_lock(&orphan_dir_inode->i_mutex); |
753 | status = ocfs2_inode_lock(orphan_dir_inode, &orphan_dir_bh, 1); | 754 | status = ocfs2_inode_lock(orphan_dir_inode, &orphan_dir_bh, 1); |
754 | if (status < 0) { | 755 | if (status < 0) { |
755 | mutex_unlock(&orphan_dir_inode->i_mutex); | 756 | mutex_unlock(&orphan_dir_inode->i_mutex); |
756 | 757 | ||
757 | mlog_errno(status); | 758 | mlog_errno(status); |
758 | goto bail; | 759 | goto bail; |
760 | } | ||
759 | } | 761 | } |
760 | 762 | ||
761 | /* we do this while holding the orphan dir lock because we | 763 | /* we do this while holding the orphan dir lock because we |
@@ -796,6 +798,9 @@ static int ocfs2_wipe_inode(struct inode *inode, | |||
796 | mlog_errno(status); | 798 | mlog_errno(status); |
797 | 799 | ||
798 | bail_unlock_dir: | 800 | bail_unlock_dir: |
801 | if (OCFS2_I(inode)->ip_flags & OCFS2_INODE_SKIP_ORPHAN_DIR) | ||
802 | return status; | ||
803 | |||
799 | ocfs2_inode_unlock(orphan_dir_inode, 1); | 804 | ocfs2_inode_unlock(orphan_dir_inode, 1); |
800 | mutex_unlock(&orphan_dir_inode->i_mutex); | 805 | mutex_unlock(&orphan_dir_inode->i_mutex); |
801 | brelse(orphan_dir_bh); | 806 | brelse(orphan_dir_bh); |
@@ -891,7 +896,8 @@ static int ocfs2_query_inode_wipe(struct inode *inode, | |||
891 | 896 | ||
892 | /* Do some basic inode verification... */ | 897 | /* Do some basic inode verification... */ |
893 | di = (struct ocfs2_dinode *) di_bh->b_data; | 898 | di = (struct ocfs2_dinode *) di_bh->b_data; |
894 | if (!(di->i_flags & cpu_to_le32(OCFS2_ORPHANED_FL))) { | 899 | if (!(di->i_flags & cpu_to_le32(OCFS2_ORPHANED_FL)) && |
900 | !(oi->ip_flags & OCFS2_INODE_SKIP_ORPHAN_DIR)) { | ||
895 | /* | 901 | /* |
896 | * Inodes in the orphan dir must have ORPHANED_FL. The only | 902 | * Inodes in the orphan dir must have ORPHANED_FL. The only |
897 | * inodes that come back out of the orphan dir are reflink | 903 | * inodes that come back out of the orphan dir are reflink |