aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-08-16 04:42:07 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 02:45:25 -0400
commiteb9df39daf870d6f9e9528f092d506be04ebad2f (patch)
tree77646f792ae63f00d3e08e6081e80afefe87e4e7
parent49ee6c911f0ae5b3a9a04e0589e3265e52f94f53 (diff)
[XFS] remove unessecary vfs argument to DM_EVENT_ENABLED
SGI-PV: 968690 SGI-Modid: xfs-linux-melb:xfs-kern:29340a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Vlad Apostolov <vapo@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c17
-rw-r--r--fs/xfs/xfs_bmap.c7
-rw-r--r--fs/xfs/xfs_dmapi.h10
-rw-r--r--fs/xfs/xfs_rename.c10
-rw-r--r--fs/xfs/xfs_vnodeops.c52
6 files changed, 38 insertions, 60 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 0d4001eafd16..4fc0f58edacf 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -405,7 +405,7 @@ xfs_file_open_exec(
405 405
406 if (!ip) 406 if (!ip)
407 return -EINVAL; 407 return -EINVAL;
408 if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ)) 408 if (DM_EVENT_ENABLED(ip, DM_EVENT_READ))
409 return -XFS_SEND_DATA(mp, DM_EVENT_READ, vp, 409 return -XFS_SEND_DATA(mp, DM_EVENT_READ, vp,
410 0, 0, 0, NULL); 410 0, 0, 0, NULL);
411 } 411 }
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index 765ec16a6e39..94941da6c4da 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -245,8 +245,7 @@ xfs_read(
245 mutex_lock(&inode->i_mutex); 245 mutex_lock(&inode->i_mutex);
246 xfs_ilock(ip, XFS_IOLOCK_SHARED); 246 xfs_ilock(ip, XFS_IOLOCK_SHARED);
247 247
248 if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) && 248 if (DM_EVENT_ENABLED(ip, DM_EVENT_READ) && !(ioflags & IO_INVIS)) {
249 !(ioflags & IO_INVIS)) {
250 bhv_vrwlock_t locktype = VRWLOCK_READ; 249 bhv_vrwlock_t locktype = VRWLOCK_READ;
251 int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG_RD(ioflags); 250 int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG_RD(ioflags);
252 251
@@ -307,8 +306,7 @@ xfs_splice_read(
307 306
308 xfs_ilock(ip, XFS_IOLOCK_SHARED); 307 xfs_ilock(ip, XFS_IOLOCK_SHARED);
309 308
310 if (DM_EVENT_ENABLED(BHV_TO_VNODE(bdp)->v_vfsp, ip, DM_EVENT_READ) && 309 if (DM_EVENT_ENABLED(ip, DM_EVENT_READ) && !(ioflags & IO_INVIS)) {
311 (!(ioflags & IO_INVIS))) {
312 bhv_vrwlock_t locktype = VRWLOCK_READ; 310 bhv_vrwlock_t locktype = VRWLOCK_READ;
313 int error; 311 int error;
314 312
@@ -354,8 +352,7 @@ xfs_splice_write(
354 352
355 xfs_ilock(ip, XFS_IOLOCK_EXCL); 353 xfs_ilock(ip, XFS_IOLOCK_EXCL);
356 354
357 if (DM_EVENT_ENABLED(BHV_TO_VNODE(bdp)->v_vfsp, ip, DM_EVENT_WRITE) && 355 if (DM_EVENT_ENABLED(ip, DM_EVENT_WRITE) && !(ioflags & IO_INVIS)) {
358 (!(ioflags & IO_INVIS))) {
359 bhv_vrwlock_t locktype = VRWLOCK_WRITE; 356 bhv_vrwlock_t locktype = VRWLOCK_WRITE;
360 int error; 357 int error;
361 358
@@ -664,7 +661,7 @@ start:
664 goto out_unlock_mutex; 661 goto out_unlock_mutex;
665 } 662 }
666 663
667 if ((DM_EVENT_ENABLED(vp->v_vfsp, xip, DM_EVENT_WRITE) && 664 if ((DM_EVENT_ENABLED(xip, DM_EVENT_WRITE) &&
668 !(ioflags & IO_INVIS) && !eventsent)) { 665 !(ioflags & IO_INVIS) && !eventsent)) {
669 int dmflags = FILP_DELAY_FLAG(file); 666 int dmflags = FILP_DELAY_FLAG(file);
670 667
@@ -816,10 +813,8 @@ retry:
816 if (ret == -EIOCBQUEUED && !(ioflags & IO_ISAIO)) 813 if (ret == -EIOCBQUEUED && !(ioflags & IO_ISAIO))
817 ret = wait_on_sync_kiocb(iocb); 814 ret = wait_on_sync_kiocb(iocb);
818 815
819 if ((ret == -ENOSPC) && 816 if (ret == -ENOSPC &&
820 DM_EVENT_ENABLED(vp->v_vfsp, xip, DM_EVENT_NOSPACE) && 817 DM_EVENT_ENABLED(xip, DM_EVENT_NOSPACE) && !(ioflags & IO_INVIS)) {
821 !(ioflags & IO_INVIS)) {
822
823 xfs_rwunlock(bdp, locktype); 818 xfs_rwunlock(bdp, locktype);
824 if (need_i_mutex) 819 if (need_i_mutex)
825 mutex_unlock(&inode->i_mutex); 820 mutex_unlock(&inode->i_mutex);
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 9abe93cfb5cc..ea4eab14a603 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -5811,10 +5811,9 @@ xfs_getbmap(
5811 * could misinterpret holes in a DMAPI file as true holes, 5811 * could misinterpret holes in a DMAPI file as true holes,
5812 * when in fact they may represent offline user data. 5812 * when in fact they may represent offline user data.
5813 */ 5813 */
5814 if ( (interface & BMV_IF_NO_DMAPI_READ) == 0 5814 if ((interface & BMV_IF_NO_DMAPI_READ) == 0 &&
5815 && DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) 5815 DM_EVENT_ENABLED(ip, DM_EVENT_READ) &&
5816 && whichfork == XFS_DATA_FORK) { 5816 whichfork == XFS_DATA_FORK) {
5817
5818 error = XFS_SEND_DATA(mp, DM_EVENT_READ, vp, 0, 0, 0, NULL); 5817 error = XFS_SEND_DATA(mp, DM_EVENT_READ, vp, 0, 0, 0, NULL);
5819 if (error) 5818 if (error)
5820 return XFS_ERROR(error); 5819 return XFS_ERROR(error);
diff --git a/fs/xfs/xfs_dmapi.h b/fs/xfs/xfs_dmapi.h
index adc3d251240d..988cf446d9e7 100644
--- a/fs/xfs/xfs_dmapi.h
+++ b/fs/xfs/xfs_dmapi.h
@@ -67,18 +67,12 @@ typedef enum {
67#define HAVE_DM_RIGHT_T 67#define HAVE_DM_RIGHT_T
68 68
69/* Defines for determining if an event message should be sent. */ 69/* Defines for determining if an event message should be sent. */
70#define DM_EVENT_ENABLED(vfsp, ip, event) ( \ 70#define DM_EVENT_ENABLED(ip, event) ( \
71 unlikely ((vfsp)->vfs_flag & VFS_DMI) && \ 71 unlikely (XFS_MTOVFS((ip)->i_mount)->vfs_flag & VFS_DMI) && \
72 ( ((ip)->i_d.di_dmevmask & (1 << event)) || \ 72 ( ((ip)->i_d.di_dmevmask & (1 << event)) || \
73 ((ip)->i_mount->m_dmevmask & (1 << event)) ) \ 73 ((ip)->i_mount->m_dmevmask & (1 << event)) ) \
74 ) 74 )
75 75
76#define DM_EVENT_ENABLED_IO(vfsp, io, event) ( \
77 unlikely ((vfsp)->vfs_flag & VFS_DMI) && \
78 ( ((io)->io_dmevmask & (1 << event)) || \
79 ((io)->io_mount->m_dmevmask & (1 << event)) ) \
80 )
81
82#define DM_XFS_VALID_FS_EVENTS ( \ 76#define DM_XFS_VALID_FS_EVENTS ( \
83 (1 << DM_EVENT_PREUNMOUNT) | \ 77 (1 << DM_EVENT_PREUNMOUNT) | \
84 (1 << DM_EVENT_UNMOUNT) | \ 78 (1 << DM_EVENT_UNMOUNT) | \
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c
index 7679d7a7022d..53d9600af4a4 100644
--- a/fs/xfs/xfs_rename.c
+++ b/fs/xfs/xfs_rename.c
@@ -264,9 +264,8 @@ xfs_rename(
264 src_dp = XFS_BHVTOI(src_dir_bdp); 264 src_dp = XFS_BHVTOI(src_dir_bdp);
265 mp = src_dp->i_mount; 265 mp = src_dp->i_mount;
266 266
267 if (DM_EVENT_ENABLED(src_dir_vp->v_vfsp, src_dp, DM_EVENT_RENAME) || 267 if (DM_EVENT_ENABLED(src_dp, DM_EVENT_RENAME) ||
268 DM_EVENT_ENABLED(target_dir_vp->v_vfsp, 268 DM_EVENT_ENABLED(target_dp, DM_EVENT_RENAME)) {
269 target_dp, DM_EVENT_RENAME)) {
270 error = XFS_SEND_NAMESP(mp, DM_EVENT_RENAME, 269 error = XFS_SEND_NAMESP(mp, DM_EVENT_RENAME,
271 src_dir_vp, DM_RIGHT_NULL, 270 src_dir_vp, DM_RIGHT_NULL,
272 target_dir_vp, DM_RIGHT_NULL, 271 target_dir_vp, DM_RIGHT_NULL,
@@ -603,9 +602,8 @@ xfs_rename(
603 /* Fall through to std_return with error = 0 or errno from 602 /* Fall through to std_return with error = 0 or errno from
604 * xfs_trans_commit */ 603 * xfs_trans_commit */
605std_return: 604std_return:
606 if (DM_EVENT_ENABLED(src_dir_vp->v_vfsp, src_dp, DM_EVENT_POSTRENAME) || 605 if (DM_EVENT_ENABLED(src_dp, DM_EVENT_POSTRENAME) ||
607 DM_EVENT_ENABLED(target_dir_vp->v_vfsp, 606 DM_EVENT_ENABLED(target_dp, DM_EVENT_POSTRENAME)) {
608 target_dp, DM_EVENT_POSTRENAME)) {
609 (void) XFS_SEND_NAMESP (mp, DM_EVENT_POSTRENAME, 607 (void) XFS_SEND_NAMESP (mp, DM_EVENT_POSTRENAME,
610 src_dir_vp, DM_RIGHT_NULL, 608 src_dir_vp, DM_RIGHT_NULL,
611 target_dir_vp, DM_RIGHT_NULL, 609 target_dir_vp, DM_RIGHT_NULL,
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 603459229904..0116ce1ad59e 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -337,7 +337,7 @@ xfs_setattr(
337 } 337 }
338 } 338 }
339 } else { 339 } else {
340 if (DM_EVENT_ENABLED (vp->v_vfsp, ip, DM_EVENT_TRUNCATE) && 340 if (DM_EVENT_ENABLED(ip, DM_EVENT_TRUNCATE) &&
341 !(flags & ATTR_DMI)) { 341 !(flags & ATTR_DMI)) {
342 int dmflags = AT_DELAY_FLAG(flags) | DM_SEM_FLAG_WR; 342 int dmflags = AT_DELAY_FLAG(flags) | DM_SEM_FLAG_WR;
343 code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, vp, 343 code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, vp,
@@ -896,7 +896,7 @@ xfs_setattr(
896 return code; 896 return code;
897 } 897 }
898 898
899 if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_ATTRIBUTE) && 899 if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE) &&
900 !(flags & ATTR_DMI)) { 900 !(flags & ATTR_DMI)) {
901 (void) XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, vp, DM_RIGHT_NULL, 901 (void) XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, vp, DM_RIGHT_NULL,
902 NULL, DM_RIGHT_NULL, NULL, NULL, 902 NULL, DM_RIGHT_NULL, NULL, NULL,
@@ -1666,8 +1666,7 @@ xfs_inactive(
1666 1666
1667 mp = ip->i_mount; 1667 mp = ip->i_mount;
1668 1668
1669 if (ip->i_d.di_nlink == 0 && 1669 if (ip->i_d.di_nlink == 0 && DM_EVENT_ENABLED(ip, DM_EVENT_DESTROY)) {
1670 DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_DESTROY)) {
1671 (void) XFS_SEND_DESTROY(mp, vp, DM_RIGHT_NULL); 1670 (void) XFS_SEND_DESTROY(mp, vp, DM_RIGHT_NULL);
1672 } 1671 }
1673 1672
@@ -1922,7 +1921,7 @@ xfs_create(
1922 dm_di_mode = vap->va_mode; 1921 dm_di_mode = vap->va_mode;
1923 namelen = VNAMELEN(dentry); 1922 namelen = VNAMELEN(dentry);
1924 1923
1925 if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_CREATE)) { 1924 if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) {
1926 error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE, 1925 error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE,
1927 dir_vp, DM_RIGHT_NULL, NULL, 1926 dir_vp, DM_RIGHT_NULL, NULL,
1928 DM_RIGHT_NULL, name, NULL, 1927 DM_RIGHT_NULL, name, NULL,
@@ -2087,9 +2086,8 @@ xfs_create(
2087 /* Fallthrough to std_return with error = 0 */ 2086 /* Fallthrough to std_return with error = 0 */
2088 2087
2089std_return: 2088std_return:
2090 if ( (*vpp || (error != 0 && dm_event_sent != 0)) && 2089 if ((*vpp || (error != 0 && dm_event_sent != 0)) &&
2091 DM_EVENT_ENABLED(dir_vp->v_vfsp, XFS_BHVTOI(dir_bdp), 2090 DM_EVENT_ENABLED(XFS_BHVTOI(dir_bdp), DM_EVENT_POSTCREATE)) {
2092 DM_EVENT_POSTCREATE)) {
2093 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE, 2091 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE,
2094 dir_vp, DM_RIGHT_NULL, 2092 dir_vp, DM_RIGHT_NULL,
2095 *vpp ? vp:NULL, 2093 *vpp ? vp:NULL,
@@ -2423,7 +2421,7 @@ xfs_remove(
2423 IRELE(ip); 2421 IRELE(ip);
2424 } 2422 }
2425 2423
2426 if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) { 2424 if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) {
2427 error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, dir_vp, 2425 error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, dir_vp,
2428 DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, 2426 DM_RIGHT_NULL, NULL, DM_RIGHT_NULL,
2429 name, NULL, dm_di_mode, 0, 0); 2427 name, NULL, dm_di_mode, 0, 0);
@@ -2599,8 +2597,7 @@ xfs_remove(
2599 2597
2600/* Fall through to std_return with error = 0 */ 2598/* Fall through to std_return with error = 0 */
2601 std_return: 2599 std_return:
2602 if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, 2600 if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) {
2603 DM_EVENT_POSTREMOVE)) {
2604 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, 2601 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE,
2605 dir_vp, DM_RIGHT_NULL, 2602 dir_vp, DM_RIGHT_NULL,
2606 NULL, DM_RIGHT_NULL, 2603 NULL, DM_RIGHT_NULL,
@@ -2677,7 +2674,7 @@ xfs_link(
2677 if (XFS_FORCED_SHUTDOWN(mp)) 2674 if (XFS_FORCED_SHUTDOWN(mp))
2678 return XFS_ERROR(EIO); 2675 return XFS_ERROR(EIO);
2679 2676
2680 if (DM_EVENT_ENABLED(src_vp->v_vfsp, tdp, DM_EVENT_LINK)) { 2677 if (DM_EVENT_ENABLED(tdp, DM_EVENT_LINK)) {
2681 error = XFS_SEND_NAMESP(mp, DM_EVENT_LINK, 2678 error = XFS_SEND_NAMESP(mp, DM_EVENT_LINK,
2682 target_dir_vp, DM_RIGHT_NULL, 2679 target_dir_vp, DM_RIGHT_NULL,
2683 src_vp, DM_RIGHT_NULL, 2680 src_vp, DM_RIGHT_NULL,
@@ -2788,8 +2785,7 @@ xfs_link(
2788 2785
2789 /* Fall through to std_return with error = 0. */ 2786 /* Fall through to std_return with error = 0. */
2790std_return: 2787std_return:
2791 if (DM_EVENT_ENABLED(src_vp->v_vfsp, sip, 2788 if (DM_EVENT_ENABLED(sip, DM_EVENT_POSTLINK)) {
2792 DM_EVENT_POSTLINK)) {
2793 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTLINK, 2789 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTLINK,
2794 target_dir_vp, DM_RIGHT_NULL, 2790 target_dir_vp, DM_RIGHT_NULL,
2795 src_vp, DM_RIGHT_NULL, 2791 src_vp, DM_RIGHT_NULL,
@@ -2853,7 +2849,7 @@ xfs_mkdir(
2853 dp_joined_to_trans = B_FALSE; 2849 dp_joined_to_trans = B_FALSE;
2854 dm_di_mode = vap->va_mode; 2850 dm_di_mode = vap->va_mode;
2855 2851
2856 if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_CREATE)) { 2852 if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) {
2857 error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE, 2853 error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE,
2858 dir_vp, DM_RIGHT_NULL, NULL, 2854 dir_vp, DM_RIGHT_NULL, NULL,
2859 DM_RIGHT_NULL, dir_name, NULL, 2855 DM_RIGHT_NULL, dir_name, NULL,
@@ -3010,9 +3006,8 @@ xfs_mkdir(
3010 * xfs_trans_commit. */ 3006 * xfs_trans_commit. */
3011 3007
3012std_return: 3008std_return:
3013 if ( (created || (error != 0 && dm_event_sent != 0)) && 3009 if ((created || (error != 0 && dm_event_sent != 0)) &&
3014 DM_EVENT_ENABLED(dir_vp->v_vfsp, XFS_BHVTOI(dir_bdp), 3010 DM_EVENT_ENABLED(XFS_BHVTOI(dir_bdp), DM_EVENT_POSTCREATE)) {
3015 DM_EVENT_POSTCREATE)) {
3016 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE, 3011 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE,
3017 dir_vp, DM_RIGHT_NULL, 3012 dir_vp, DM_RIGHT_NULL,
3018 created ? XFS_ITOV(cdp):NULL, 3013 created ? XFS_ITOV(cdp):NULL,
@@ -3081,7 +3076,7 @@ xfs_rmdir(
3081 IRELE(cdp); 3076 IRELE(cdp);
3082 } 3077 }
3083 3078
3084 if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_REMOVE)) { 3079 if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) {
3085 error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, 3080 error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE,
3086 dir_vp, DM_RIGHT_NULL, 3081 dir_vp, DM_RIGHT_NULL,
3087 NULL, DM_RIGHT_NULL, 3082 NULL, DM_RIGHT_NULL,
@@ -3270,7 +3265,7 @@ xfs_rmdir(
3270 /* Fall through to std_return with error = 0 or the errno 3265 /* Fall through to std_return with error = 0 or the errno
3271 * from xfs_trans_commit. */ 3266 * from xfs_trans_commit. */
3272 std_return: 3267 std_return:
3273 if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_POSTREMOVE)) { 3268 if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) {
3274 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, 3269 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE,
3275 dir_vp, DM_RIGHT_NULL, 3270 dir_vp, DM_RIGHT_NULL,
3276 NULL, DM_RIGHT_NULL, 3271 NULL, DM_RIGHT_NULL,
@@ -3405,7 +3400,7 @@ xfs_symlink(
3405 } 3400 }
3406 } 3401 }
3407 3402
3408 if (DM_EVENT_ENABLED(dir_vp->v_vfsp, dp, DM_EVENT_SYMLINK)) { 3403 if (DM_EVENT_ENABLED(dp, DM_EVENT_SYMLINK)) {
3409 error = XFS_SEND_NAMESP(mp, DM_EVENT_SYMLINK, dir_vp, 3404 error = XFS_SEND_NAMESP(mp, DM_EVENT_SYMLINK, dir_vp,
3410 DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, 3405 DM_RIGHT_NULL, NULL, DM_RIGHT_NULL,
3411 link_name, target_path, 0, 0, 0); 3406 link_name, target_path, 0, 0, 0);
@@ -3605,8 +3600,7 @@ xfs_symlink(
3605 /* Fall through to std_return with error = 0 or errno from 3600 /* Fall through to std_return with error = 0 or errno from
3606 * xfs_trans_commit */ 3601 * xfs_trans_commit */
3607std_return: 3602std_return:
3608 if (DM_EVENT_ENABLED(dir_vp->v_vfsp, XFS_BHVTOI(dir_bdp), 3603 if (DM_EVENT_ENABLED(XFS_BHVTOI(dir_bdp), DM_EVENT_POSTSYMLINK)) {
3609 DM_EVENT_POSTSYMLINK)) {
3610 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTSYMLINK, 3604 (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTSYMLINK,
3611 dir_vp, DM_RIGHT_NULL, 3605 dir_vp, DM_RIGHT_NULL,
3612 error ? NULL : XFS_ITOV(ip), 3606 error ? NULL : XFS_ITOV(ip),
@@ -4109,7 +4103,7 @@ xfs_alloc_file_space(
4109 /* Generate a DMAPI event if needed. */ 4103 /* Generate a DMAPI event if needed. */
4110 if (alloc_type != 0 && offset < ip->i_size && 4104 if (alloc_type != 0 && offset < ip->i_size &&
4111 (attr_flags&ATTR_DMI) == 0 && 4105 (attr_flags&ATTR_DMI) == 0 &&
4112 DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_WRITE)) { 4106 DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) {
4113 xfs_off_t end_dmi_offset; 4107 xfs_off_t end_dmi_offset;
4114 4108
4115 end_dmi_offset = offset+len; 4109 end_dmi_offset = offset+len;
@@ -4223,9 +4217,8 @@ retry:
4223 allocatesize_fsb -= allocated_fsb; 4217 allocatesize_fsb -= allocated_fsb;
4224 } 4218 }
4225dmapi_enospc_check: 4219dmapi_enospc_check:
4226 if (error == ENOSPC && (attr_flags&ATTR_DMI) == 0 && 4220 if (error == ENOSPC && (attr_flags & ATTR_DMI) == 0 &&
4227 DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_NOSPACE)) { 4221 DM_EVENT_ENABLED(ip, DM_EVENT_NOSPACE)) {
4228
4229 error = XFS_SEND_NAMESP(mp, DM_EVENT_NOSPACE, 4222 error = XFS_SEND_NAMESP(mp, DM_EVENT_NOSPACE,
4230 XFS_ITOV(ip), DM_RIGHT_NULL, 4223 XFS_ITOV(ip), DM_RIGHT_NULL,
4231 XFS_ITOV(ip), DM_RIGHT_NULL, 4224 XFS_ITOV(ip), DM_RIGHT_NULL,
@@ -4369,9 +4362,8 @@ xfs_free_file_space(
4369 end_dmi_offset = offset + len; 4362 end_dmi_offset = offset + len;
4370 endoffset_fsb = XFS_B_TO_FSBT(mp, end_dmi_offset); 4363 endoffset_fsb = XFS_B_TO_FSBT(mp, end_dmi_offset);
4371 4364
4372 if (offset < ip->i_size && 4365 if (offset < ip->i_size && (attr_flags & ATTR_DMI) == 0 &&
4373 (attr_flags & ATTR_DMI) == 0 && 4366 DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) {
4374 DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_WRITE)) {
4375 if (end_dmi_offset > ip->i_size) 4367 if (end_dmi_offset > ip->i_size)
4376 end_dmi_offset = ip->i_size; 4368 end_dmi_offset = ip->i_size;
4377 error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, vp, 4369 error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, vp,