diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_file.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_file.c | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c index 257a56b127cf..dca06131551a 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/linux-2.6/xfs_file.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include "xfs_ag.h" | 24 | #include "xfs_ag.h" |
25 | #include "xfs_dir2.h" | 25 | #include "xfs_dir2.h" |
26 | #include "xfs_trans.h" | 26 | #include "xfs_trans.h" |
27 | #include "xfs_dmapi.h" | ||
28 | #include "xfs_mount.h" | 27 | #include "xfs_mount.h" |
29 | #include "xfs_bmap_btree.h" | 28 | #include "xfs_bmap_btree.h" |
30 | #include "xfs_alloc_btree.h" | 29 | #include "xfs_alloc_btree.h" |
@@ -275,20 +274,6 @@ xfs_file_aio_read( | |||
275 | mutex_lock(&inode->i_mutex); | 274 | mutex_lock(&inode->i_mutex); |
276 | xfs_ilock(ip, XFS_IOLOCK_SHARED); | 275 | xfs_ilock(ip, XFS_IOLOCK_SHARED); |
277 | 276 | ||
278 | if (DM_EVENT_ENABLED(ip, DM_EVENT_READ) && !(ioflags & IO_INVIS)) { | ||
279 | int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG_RD(ioflags); | ||
280 | int iolock = XFS_IOLOCK_SHARED; | ||
281 | |||
282 | ret = -XFS_SEND_DATA(mp, DM_EVENT_READ, ip, iocb->ki_pos, size, | ||
283 | dmflags, &iolock); | ||
284 | if (ret) { | ||
285 | xfs_iunlock(ip, XFS_IOLOCK_SHARED); | ||
286 | if (unlikely(ioflags & IO_ISDIRECT)) | ||
287 | mutex_unlock(&inode->i_mutex); | ||
288 | return ret; | ||
289 | } | ||
290 | } | ||
291 | |||
292 | if (unlikely(ioflags & IO_ISDIRECT)) { | 277 | if (unlikely(ioflags & IO_ISDIRECT)) { |
293 | if (inode->i_mapping->nrpages) { | 278 | if (inode->i_mapping->nrpages) { |
294 | ret = -xfs_flushinval_pages(ip, | 279 | ret = -xfs_flushinval_pages(ip, |
@@ -321,7 +306,6 @@ xfs_file_splice_read( | |||
321 | unsigned int flags) | 306 | unsigned int flags) |
322 | { | 307 | { |
323 | struct xfs_inode *ip = XFS_I(infilp->f_mapping->host); | 308 | struct xfs_inode *ip = XFS_I(infilp->f_mapping->host); |
324 | struct xfs_mount *mp = ip->i_mount; | ||
325 | int ioflags = 0; | 309 | int ioflags = 0; |
326 | ssize_t ret; | 310 | ssize_t ret; |
327 | 311 | ||
@@ -335,18 +319,6 @@ xfs_file_splice_read( | |||
335 | 319 | ||
336 | xfs_ilock(ip, XFS_IOLOCK_SHARED); | 320 | xfs_ilock(ip, XFS_IOLOCK_SHARED); |
337 | 321 | ||
338 | if (DM_EVENT_ENABLED(ip, DM_EVENT_READ) && !(ioflags & IO_INVIS)) { | ||
339 | int iolock = XFS_IOLOCK_SHARED; | ||
340 | int error; | ||
341 | |||
342 | error = XFS_SEND_DATA(mp, DM_EVENT_READ, ip, *ppos, count, | ||
343 | FILP_DELAY_FLAG(infilp), &iolock); | ||
344 | if (error) { | ||
345 | xfs_iunlock(ip, XFS_IOLOCK_SHARED); | ||
346 | return -error; | ||
347 | } | ||
348 | } | ||
349 | |||
350 | trace_xfs_file_splice_read(ip, count, *ppos, ioflags); | 322 | trace_xfs_file_splice_read(ip, count, *ppos, ioflags); |
351 | 323 | ||
352 | ret = generic_file_splice_read(infilp, ppos, pipe, count, flags); | 324 | ret = generic_file_splice_read(infilp, ppos, pipe, count, flags); |
@@ -367,7 +339,6 @@ xfs_file_splice_write( | |||
367 | { | 339 | { |
368 | struct inode *inode = outfilp->f_mapping->host; | 340 | struct inode *inode = outfilp->f_mapping->host; |
369 | struct xfs_inode *ip = XFS_I(inode); | 341 | struct xfs_inode *ip = XFS_I(inode); |
370 | struct xfs_mount *mp = ip->i_mount; | ||
371 | xfs_fsize_t isize, new_size; | 342 | xfs_fsize_t isize, new_size; |
372 | int ioflags = 0; | 343 | int ioflags = 0; |
373 | ssize_t ret; | 344 | ssize_t ret; |
@@ -382,18 +353,6 @@ xfs_file_splice_write( | |||
382 | 353 | ||
383 | xfs_ilock(ip, XFS_IOLOCK_EXCL); | 354 | xfs_ilock(ip, XFS_IOLOCK_EXCL); |
384 | 355 | ||
385 | if (DM_EVENT_ENABLED(ip, DM_EVENT_WRITE) && !(ioflags & IO_INVIS)) { | ||
386 | int iolock = XFS_IOLOCK_EXCL; | ||
387 | int error; | ||
388 | |||
389 | error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, ip, *ppos, count, | ||
390 | FILP_DELAY_FLAG(outfilp), &iolock); | ||
391 | if (error) { | ||
392 | xfs_iunlock(ip, XFS_IOLOCK_EXCL); | ||
393 | return -error; | ||
394 | } | ||
395 | } | ||
396 | |||
397 | new_size = *ppos + count; | 356 | new_size = *ppos + count; |
398 | 357 | ||
399 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 358 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
@@ -627,7 +586,6 @@ xfs_file_aio_write( | |||
627 | int ioflags = 0; | 586 | int ioflags = 0; |
628 | xfs_fsize_t isize, new_size; | 587 | xfs_fsize_t isize, new_size; |
629 | int iolock; | 588 | int iolock; |
630 | int eventsent = 0; | ||
631 | size_t ocount = 0, count; | 589 | size_t ocount = 0, count; |
632 | int need_i_mutex; | 590 | int need_i_mutex; |
633 | 591 | ||
@@ -673,33 +631,6 @@ start: | |||
673 | goto out_unlock_mutex; | 631 | goto out_unlock_mutex; |
674 | } | 632 | } |
675 | 633 | ||
676 | if ((DM_EVENT_ENABLED(ip, DM_EVENT_WRITE) && | ||
677 | !(ioflags & IO_INVIS) && !eventsent)) { | ||
678 | int dmflags = FILP_DELAY_FLAG(file); | ||
679 | |||
680 | if (need_i_mutex) | ||
681 | dmflags |= DM_FLAGS_IMUX; | ||
682 | |||
683 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | ||
684 | error = XFS_SEND_DATA(ip->i_mount, DM_EVENT_WRITE, ip, | ||
685 | pos, count, dmflags, &iolock); | ||
686 | if (error) { | ||
687 | goto out_unlock_internal; | ||
688 | } | ||
689 | xfs_ilock(ip, XFS_ILOCK_EXCL); | ||
690 | eventsent = 1; | ||
691 | |||
692 | /* | ||
693 | * The iolock was dropped and reacquired in XFS_SEND_DATA | ||
694 | * so we have to recheck the size when appending. | ||
695 | * We will only "goto start;" once, since having sent the | ||
696 | * event prevents another call to XFS_SEND_DATA, which is | ||
697 | * what allows the size to change in the first place. | ||
698 | */ | ||
699 | if ((file->f_flags & O_APPEND) && pos != ip->i_size) | ||
700 | goto start; | ||
701 | } | ||
702 | |||
703 | if (ioflags & IO_ISDIRECT) { | 634 | if (ioflags & IO_ISDIRECT) { |
704 | xfs_buftarg_t *target = | 635 | xfs_buftarg_t *target = |
705 | XFS_IS_REALTIME_INODE(ip) ? | 636 | XFS_IS_REALTIME_INODE(ip) ? |
@@ -830,22 +761,6 @@ write_retry: | |||
830 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | 761 | xfs_iunlock(ip, XFS_ILOCK_EXCL); |
831 | } | 762 | } |
832 | 763 | ||
833 | if (ret == -ENOSPC && | ||
834 | DM_EVENT_ENABLED(ip, DM_EVENT_NOSPACE) && !(ioflags & IO_INVIS)) { | ||
835 | xfs_iunlock(ip, iolock); | ||
836 | if (need_i_mutex) | ||
837 | mutex_unlock(&inode->i_mutex); | ||
838 | error = XFS_SEND_NAMESP(ip->i_mount, DM_EVENT_NOSPACE, ip, | ||
839 | DM_RIGHT_NULL, ip, DM_RIGHT_NULL, NULL, NULL, | ||
840 | 0, 0, 0); /* Delay flag intentionally unused */ | ||
841 | if (need_i_mutex) | ||
842 | mutex_lock(&inode->i_mutex); | ||
843 | xfs_ilock(ip, iolock); | ||
844 | if (error) | ||
845 | goto out_unlock_internal; | ||
846 | goto start; | ||
847 | } | ||
848 | |||
849 | error = -ret; | 764 | error = -ret; |
850 | if (ret <= 0) | 765 | if (ret <= 0) |
851 | goto out_unlock_internal; | 766 | goto out_unlock_internal; |