diff options
Diffstat (limited to 'fs/ocfs2/inode.c')
-rw-r--r-- | fs/ocfs2/inode.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index 4a88bce35079..10e1fa87396a 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c | |||
@@ -113,6 +113,17 @@ void ocfs2_get_inode_flags(struct ocfs2_inode_info *oi) | |||
113 | oi->ip_attr |= OCFS2_DIRSYNC_FL; | 113 | oi->ip_attr |= OCFS2_DIRSYNC_FL; |
114 | } | 114 | } |
115 | 115 | ||
116 | struct inode *ocfs2_ilookup(struct super_block *sb, u64 blkno) | ||
117 | { | ||
118 | struct ocfs2_find_inode_args args; | ||
119 | |||
120 | args.fi_blkno = blkno; | ||
121 | args.fi_flags = 0; | ||
122 | args.fi_ino = ino_from_blkno(sb, blkno); | ||
123 | args.fi_sysfile_type = 0; | ||
124 | |||
125 | return ilookup5(sb, blkno, ocfs2_find_actor, &args); | ||
126 | } | ||
116 | struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags, | 127 | struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags, |
117 | int sysfile_type) | 128 | int sysfile_type) |
118 | { | 129 | { |
@@ -961,6 +972,17 @@ void ocfs2_delete_inode(struct inode *inode) | |||
961 | goto bail; | 972 | goto bail; |
962 | } | 973 | } |
963 | 974 | ||
975 | /* | ||
976 | * Synchronize us against ocfs2_get_dentry. We take this in | ||
977 | * shared mode so that all nodes can still concurrently | ||
978 | * process deletes. | ||
979 | */ | ||
980 | status = ocfs2_nfs_sync_lock(OCFS2_SB(inode->i_sb), 0); | ||
981 | if (status < 0) { | ||
982 | mlog(ML_ERROR, "getting nfs sync lock(PR) failed %d\n", status); | ||
983 | ocfs2_cleanup_delete_inode(inode, 0); | ||
984 | goto bail_unblock; | ||
985 | } | ||
964 | /* Lock down the inode. This gives us an up to date view of | 986 | /* Lock down the inode. This gives us an up to date view of |
965 | * it's metadata (for verification), and allows us to | 987 | * it's metadata (for verification), and allows us to |
966 | * serialize delete_inode on multiple nodes. | 988 | * serialize delete_inode on multiple nodes. |
@@ -974,7 +996,7 @@ void ocfs2_delete_inode(struct inode *inode) | |||
974 | if (status != -ENOENT) | 996 | if (status != -ENOENT) |
975 | mlog_errno(status); | 997 | mlog_errno(status); |
976 | ocfs2_cleanup_delete_inode(inode, 0); | 998 | ocfs2_cleanup_delete_inode(inode, 0); |
977 | goto bail_unblock; | 999 | goto bail_unlock_nfs_sync; |
978 | } | 1000 | } |
979 | 1001 | ||
980 | /* Query the cluster. This will be the final decision made | 1002 | /* Query the cluster. This will be the final decision made |
@@ -1017,6 +1039,10 @@ void ocfs2_delete_inode(struct inode *inode) | |||
1017 | bail_unlock_inode: | 1039 | bail_unlock_inode: |
1018 | ocfs2_inode_unlock(inode, 1); | 1040 | ocfs2_inode_unlock(inode, 1); |
1019 | brelse(di_bh); | 1041 | brelse(di_bh); |
1042 | |||
1043 | bail_unlock_nfs_sync: | ||
1044 | ocfs2_nfs_sync_unlock(OCFS2_SB(inode->i_sb), 0); | ||
1045 | |||
1020 | bail_unblock: | 1046 | bail_unblock: |
1021 | status = sigprocmask(SIG_SETMASK, &oldset, NULL); | 1047 | status = sigprocmask(SIG_SETMASK, &oldset, NULL); |
1022 | if (status < 0) | 1048 | if (status < 0) |