diff options
Diffstat (limited to 'fs/xfs/xfs_rename.c')
-rw-r--r-- | fs/xfs/xfs_rename.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c index fc1cda23b817..fa752f495a0c 100644 --- a/fs/xfs/xfs_rename.c +++ b/fs/xfs/xfs_rename.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include "xfs_sb.h" | 24 | #include "xfs_sb.h" |
25 | #include "xfs_ag.h" | 25 | #include "xfs_ag.h" |
26 | #include "xfs_dir2.h" | 26 | #include "xfs_dir2.h" |
27 | #include "xfs_dmapi.h" | ||
28 | #include "xfs_mount.h" | 27 | #include "xfs_mount.h" |
29 | #include "xfs_da_btree.h" | 28 | #include "xfs_da_btree.h" |
30 | #include "xfs_bmap_btree.h" | 29 | #include "xfs_bmap_btree.h" |
@@ -119,18 +118,6 @@ xfs_rename( | |||
119 | xfs_itrace_entry(src_dp); | 118 | xfs_itrace_entry(src_dp); |
120 | xfs_itrace_entry(target_dp); | 119 | xfs_itrace_entry(target_dp); |
121 | 120 | ||
122 | if (DM_EVENT_ENABLED(src_dp, DM_EVENT_RENAME) || | ||
123 | DM_EVENT_ENABLED(target_dp, DM_EVENT_RENAME)) { | ||
124 | error = XFS_SEND_NAMESP(mp, DM_EVENT_RENAME, | ||
125 | src_dp, DM_RIGHT_NULL, | ||
126 | target_dp, DM_RIGHT_NULL, | ||
127 | src_name->name, target_name->name, | ||
128 | 0, 0, 0); | ||
129 | if (error) | ||
130 | return error; | ||
131 | } | ||
132 | /* Return through std_return after this point. */ | ||
133 | |||
134 | new_parent = (src_dp != target_dp); | 121 | new_parent = (src_dp != target_dp); |
135 | src_is_directory = ((src_ip->i_d.di_mode & S_IFMT) == S_IFDIR); | 122 | src_is_directory = ((src_ip->i_d.di_mode & S_IFMT) == S_IFDIR); |
136 | 123 | ||
@@ -369,26 +356,13 @@ xfs_rename( | |||
369 | * trans_commit will unlock src_ip, target_ip & decrement | 356 | * trans_commit will unlock src_ip, target_ip & decrement |
370 | * the vnode references. | 357 | * the vnode references. |
371 | */ | 358 | */ |
372 | error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); | 359 | return xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); |
373 | |||
374 | /* Fall through to std_return with error = 0 or errno from | ||
375 | * xfs_trans_commit */ | ||
376 | std_return: | ||
377 | if (DM_EVENT_ENABLED(src_dp, DM_EVENT_POSTRENAME) || | ||
378 | DM_EVENT_ENABLED(target_dp, DM_EVENT_POSTRENAME)) { | ||
379 | (void) XFS_SEND_NAMESP (mp, DM_EVENT_POSTRENAME, | ||
380 | src_dp, DM_RIGHT_NULL, | ||
381 | target_dp, DM_RIGHT_NULL, | ||
382 | src_name->name, target_name->name, | ||
383 | 0, error, 0); | ||
384 | } | ||
385 | return error; | ||
386 | 360 | ||
387 | abort_return: | 361 | abort_return: |
388 | cancel_flags |= XFS_TRANS_ABORT; | 362 | cancel_flags |= XFS_TRANS_ABORT; |
389 | /* FALLTHROUGH */ | ||
390 | error_return: | 363 | error_return: |
391 | xfs_bmap_cancel(&free_list); | 364 | xfs_bmap_cancel(&free_list); |
392 | xfs_trans_cancel(tp, cancel_flags); | 365 | xfs_trans_cancel(tp, cancel_flags); |
393 | goto std_return; | 366 | std_return: |
367 | return error; | ||
394 | } | 368 | } |