diff options
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index b77dede91b71..7e124b55c26b 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -326,7 +326,7 @@ xfs_setattr( | |||
326 | if (DM_EVENT_ENABLED(ip, DM_EVENT_TRUNCATE) && | 326 | if (DM_EVENT_ENABLED(ip, DM_EVENT_TRUNCATE) && |
327 | !(flags & ATTR_DMI)) { | 327 | !(flags & ATTR_DMI)) { |
328 | int dmflags = AT_DELAY_FLAG(flags) | DM_SEM_FLAG_WR; | 328 | int dmflags = AT_DELAY_FLAG(flags) | DM_SEM_FLAG_WR; |
329 | code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, vp, | 329 | code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, ip, |
330 | vap->va_size, 0, dmflags, NULL); | 330 | vap->va_size, 0, dmflags, NULL); |
331 | if (code) { | 331 | if (code) { |
332 | lock_flags = 0; | 332 | lock_flags = 0; |
@@ -881,7 +881,7 @@ xfs_setattr( | |||
881 | 881 | ||
882 | if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE) && | 882 | if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE) && |
883 | !(flags & ATTR_DMI)) { | 883 | !(flags & ATTR_DMI)) { |
884 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, vp, DM_RIGHT_NULL, | 884 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, ip, DM_RIGHT_NULL, |
885 | NULL, DM_RIGHT_NULL, NULL, NULL, | 885 | NULL, DM_RIGHT_NULL, NULL, NULL, |
886 | 0, 0, AT_DELAY_FLAG(flags)); | 886 | 0, 0, AT_DELAY_FLAG(flags)); |
887 | } | 887 | } |
@@ -1586,9 +1586,8 @@ xfs_inactive( | |||
1586 | 1586 | ||
1587 | mp = ip->i_mount; | 1587 | mp = ip->i_mount; |
1588 | 1588 | ||
1589 | if (ip->i_d.di_nlink == 0 && DM_EVENT_ENABLED(ip, DM_EVENT_DESTROY)) { | 1589 | if (ip->i_d.di_nlink == 0 && DM_EVENT_ENABLED(ip, DM_EVENT_DESTROY)) |
1590 | (void) XFS_SEND_DESTROY(mp, vp, DM_RIGHT_NULL); | 1590 | XFS_SEND_DESTROY(mp, ip, DM_RIGHT_NULL); |
1591 | } | ||
1592 | 1591 | ||
1593 | error = 0; | 1592 | error = 0; |
1594 | 1593 | ||
@@ -1820,7 +1819,7 @@ xfs_create( | |||
1820 | 1819 | ||
1821 | if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) { | 1820 | if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) { |
1822 | error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE, | 1821 | error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE, |
1823 | dir_vp, DM_RIGHT_NULL, NULL, | 1822 | dp, DM_RIGHT_NULL, NULL, |
1824 | DM_RIGHT_NULL, name, NULL, | 1823 | DM_RIGHT_NULL, name, NULL, |
1825 | mode, 0, 0); | 1824 | mode, 0, 0); |
1826 | 1825 | ||
@@ -1976,8 +1975,8 @@ std_return: | |||
1976 | if ((*vpp || (error != 0 && dm_event_sent != 0)) && | 1975 | if ((*vpp || (error != 0 && dm_event_sent != 0)) && |
1977 | DM_EVENT_ENABLED(dp, DM_EVENT_POSTCREATE)) { | 1976 | DM_EVENT_ENABLED(dp, DM_EVENT_POSTCREATE)) { |
1978 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE, | 1977 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE, |
1979 | dir_vp, DM_RIGHT_NULL, | 1978 | dp, DM_RIGHT_NULL, |
1980 | *vpp ? vp:NULL, | 1979 | *vpp ? ip : NULL, |
1981 | DM_RIGHT_NULL, name, NULL, | 1980 | DM_RIGHT_NULL, name, NULL, |
1982 | mode, error, 0); | 1981 | mode, error, 0); |
1983 | } | 1982 | } |
@@ -2272,7 +2271,6 @@ xfs_remove( | |||
2272 | xfs_inode_t *dp, | 2271 | xfs_inode_t *dp, |
2273 | bhv_vname_t *dentry) | 2272 | bhv_vname_t *dentry) |
2274 | { | 2273 | { |
2275 | bhv_vnode_t *dir_vp = XFS_ITOV(dp); | ||
2276 | char *name = VNAME(dentry); | 2274 | char *name = VNAME(dentry); |
2277 | xfs_mount_t *mp = dp->i_mount; | 2275 | xfs_mount_t *mp = dp->i_mount; |
2278 | xfs_inode_t *ip = VNAME_TO_INODE(dentry); | 2276 | xfs_inode_t *ip = VNAME_TO_INODE(dentry); |
@@ -2292,7 +2290,7 @@ xfs_remove( | |||
2292 | return XFS_ERROR(EIO); | 2290 | return XFS_ERROR(EIO); |
2293 | 2291 | ||
2294 | if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) { | 2292 | if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) { |
2295 | error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, dir_vp, | 2293 | error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, dp, |
2296 | DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, | 2294 | DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, |
2297 | name, NULL, ip->i_d.di_mode, 0, 0); | 2295 | name, NULL, ip->i_d.di_mode, 0, 0); |
2298 | if (error) | 2296 | if (error) |
@@ -2445,7 +2443,7 @@ xfs_remove( | |||
2445 | std_return: | 2443 | std_return: |
2446 | if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) { | 2444 | if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) { |
2447 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, | 2445 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, |
2448 | dir_vp, DM_RIGHT_NULL, | 2446 | dp, DM_RIGHT_NULL, |
2449 | NULL, DM_RIGHT_NULL, | 2447 | NULL, DM_RIGHT_NULL, |
2450 | name, NULL, ip->i_d.di_mode, error, 0); | 2448 | name, NULL, ip->i_d.di_mode, error, 0); |
2451 | } | 2449 | } |
@@ -2504,8 +2502,8 @@ xfs_link( | |||
2504 | 2502 | ||
2505 | if (DM_EVENT_ENABLED(tdp, DM_EVENT_LINK)) { | 2503 | if (DM_EVENT_ENABLED(tdp, DM_EVENT_LINK)) { |
2506 | error = XFS_SEND_NAMESP(mp, DM_EVENT_LINK, | 2504 | error = XFS_SEND_NAMESP(mp, DM_EVENT_LINK, |
2507 | target_dir_vp, DM_RIGHT_NULL, | 2505 | tdp, DM_RIGHT_NULL, |
2508 | src_vp, DM_RIGHT_NULL, | 2506 | sip, DM_RIGHT_NULL, |
2509 | target_name, NULL, 0, 0, 0); | 2507 | target_name, NULL, 0, 0, 0); |
2510 | if (error) | 2508 | if (error) |
2511 | return error; | 2509 | return error; |
@@ -2615,8 +2613,8 @@ xfs_link( | |||
2615 | std_return: | 2613 | std_return: |
2616 | if (DM_EVENT_ENABLED(sip, DM_EVENT_POSTLINK)) { | 2614 | if (DM_EVENT_ENABLED(sip, DM_EVENT_POSTLINK)) { |
2617 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTLINK, | 2615 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTLINK, |
2618 | target_dir_vp, DM_RIGHT_NULL, | 2616 | tdp, DM_RIGHT_NULL, |
2619 | src_vp, DM_RIGHT_NULL, | 2617 | sip, DM_RIGHT_NULL, |
2620 | target_name, NULL, 0, error, 0); | 2618 | target_name, NULL, 0, error, 0); |
2621 | } | 2619 | } |
2622 | return error; | 2620 | return error; |
@@ -2665,7 +2663,7 @@ xfs_mkdir( | |||
2665 | 2663 | ||
2666 | if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) { | 2664 | if (DM_EVENT_ENABLED(dp, DM_EVENT_CREATE)) { |
2667 | error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE, | 2665 | error = XFS_SEND_NAMESP(mp, DM_EVENT_CREATE, |
2668 | dir_vp, DM_RIGHT_NULL, NULL, | 2666 | dp, DM_RIGHT_NULL, NULL, |
2669 | DM_RIGHT_NULL, dir_name, NULL, | 2667 | DM_RIGHT_NULL, dir_name, NULL, |
2670 | mode, 0, 0); | 2668 | mode, 0, 0); |
2671 | if (error) | 2669 | if (error) |
@@ -2823,8 +2821,8 @@ std_return: | |||
2823 | if ((created || (error != 0 && dm_event_sent != 0)) && | 2821 | if ((created || (error != 0 && dm_event_sent != 0)) && |
2824 | DM_EVENT_ENABLED(dp, DM_EVENT_POSTCREATE)) { | 2822 | DM_EVENT_ENABLED(dp, DM_EVENT_POSTCREATE)) { |
2825 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE, | 2823 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTCREATE, |
2826 | dir_vp, DM_RIGHT_NULL, | 2824 | dp, DM_RIGHT_NULL, |
2827 | created ? XFS_ITOV(cdp):NULL, | 2825 | created ? cdp : NULL, |
2828 | DM_RIGHT_NULL, | 2826 | DM_RIGHT_NULL, |
2829 | dir_name, NULL, | 2827 | dir_name, NULL, |
2830 | mode, error, 0); | 2828 | mode, error, 0); |
@@ -2873,7 +2871,7 @@ xfs_rmdir( | |||
2873 | 2871 | ||
2874 | if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) { | 2872 | if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) { |
2875 | error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, | 2873 | error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, |
2876 | dir_vp, DM_RIGHT_NULL, | 2874 | dp, DM_RIGHT_NULL, |
2877 | NULL, DM_RIGHT_NULL, | 2875 | NULL, DM_RIGHT_NULL, |
2878 | name, NULL, cdp->i_d.di_mode, 0, 0); | 2876 | name, NULL, cdp->i_d.di_mode, 0, 0); |
2879 | if (error) | 2877 | if (error) |
@@ -3047,7 +3045,7 @@ xfs_rmdir( | |||
3047 | std_return: | 3045 | std_return: |
3048 | if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) { | 3046 | if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) { |
3049 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, | 3047 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, |
3050 | dir_vp, DM_RIGHT_NULL, | 3048 | dp, DM_RIGHT_NULL, |
3051 | NULL, DM_RIGHT_NULL, | 3049 | NULL, DM_RIGHT_NULL, |
3052 | name, NULL, cdp->i_d.di_mode, | 3050 | name, NULL, cdp->i_d.di_mode, |
3053 | error, 0); | 3051 | error, 0); |
@@ -3144,7 +3142,7 @@ xfs_symlink( | |||
3144 | } | 3142 | } |
3145 | 3143 | ||
3146 | if (DM_EVENT_ENABLED(dp, DM_EVENT_SYMLINK)) { | 3144 | if (DM_EVENT_ENABLED(dp, DM_EVENT_SYMLINK)) { |
3147 | error = XFS_SEND_NAMESP(mp, DM_EVENT_SYMLINK, dir_vp, | 3145 | error = XFS_SEND_NAMESP(mp, DM_EVENT_SYMLINK, dp, |
3148 | DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, | 3146 | DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, |
3149 | link_name, target_path, 0, 0, 0); | 3147 | link_name, target_path, 0, 0, 0); |
3150 | if (error) | 3148 | if (error) |
@@ -3348,8 +3346,8 @@ xfs_symlink( | |||
3348 | std_return: | 3346 | std_return: |
3349 | if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTSYMLINK)) { | 3347 | if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTSYMLINK)) { |
3350 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTSYMLINK, | 3348 | (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTSYMLINK, |
3351 | dir_vp, DM_RIGHT_NULL, | 3349 | dp, DM_RIGHT_NULL, |
3352 | error ? NULL : XFS_ITOV(ip), | 3350 | error ? NULL : ip, |
3353 | DM_RIGHT_NULL, link_name, target_path, | 3351 | DM_RIGHT_NULL, link_name, target_path, |
3354 | 0, error, 0); | 3352 | 0, error, 0); |
3355 | } | 3353 | } |
@@ -3707,9 +3705,8 @@ xfs_alloc_file_space( | |||
3707 | end_dmi_offset = offset+len; | 3705 | end_dmi_offset = offset+len; |
3708 | if (end_dmi_offset > ip->i_size) | 3706 | if (end_dmi_offset > ip->i_size) |
3709 | end_dmi_offset = ip->i_size; | 3707 | end_dmi_offset = ip->i_size; |
3710 | error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, XFS_ITOV(ip), | 3708 | error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, ip, offset, |
3711 | offset, end_dmi_offset - offset, | 3709 | end_dmi_offset - offset, 0, NULL); |
3712 | 0, NULL); | ||
3713 | if (error) | 3710 | if (error) |
3714 | return error; | 3711 | return error; |
3715 | } | 3712 | } |
@@ -3818,8 +3815,8 @@ dmapi_enospc_check: | |||
3818 | if (error == ENOSPC && (attr_flags & ATTR_DMI) == 0 && | 3815 | if (error == ENOSPC && (attr_flags & ATTR_DMI) == 0 && |
3819 | DM_EVENT_ENABLED(ip, DM_EVENT_NOSPACE)) { | 3816 | DM_EVENT_ENABLED(ip, DM_EVENT_NOSPACE)) { |
3820 | error = XFS_SEND_NAMESP(mp, DM_EVENT_NOSPACE, | 3817 | error = XFS_SEND_NAMESP(mp, DM_EVENT_NOSPACE, |
3821 | XFS_ITOV(ip), DM_RIGHT_NULL, | 3818 | ip, DM_RIGHT_NULL, |
3822 | XFS_ITOV(ip), DM_RIGHT_NULL, | 3819 | ip, DM_RIGHT_NULL, |
3823 | NULL, NULL, 0, 0, 0); /* Delay flag intentionally unused */ | 3820 | NULL, NULL, 0, 0, 0); /* Delay flag intentionally unused */ |
3824 | if (error == 0) | 3821 | if (error == 0) |
3825 | goto retry; /* Maybe DMAPI app. has made space */ | 3822 | goto retry; /* Maybe DMAPI app. has made space */ |
@@ -3964,7 +3961,7 @@ xfs_free_file_space( | |||
3964 | DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) { | 3961 | DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) { |
3965 | if (end_dmi_offset > ip->i_size) | 3962 | if (end_dmi_offset > ip->i_size) |
3966 | end_dmi_offset = ip->i_size; | 3963 | end_dmi_offset = ip->i_size; |
3967 | error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, vp, | 3964 | error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, ip, |
3968 | offset, end_dmi_offset - offset, | 3965 | offset, end_dmi_offset - offset, |
3969 | AT_DELAY_FLAG(attr_flags), NULL); | 3966 | AT_DELAY_FLAG(attr_flags), NULL); |
3970 | if (error) | 3967 | if (error) |