aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iomap.c
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2014-07-14 17:37:18 -0400
committerDave Chinner <david@fromorbit.com>2014-07-14 17:37:18 -0400
commit7f8a058f6dc52219117bc2469b1fb816f7fa1a4b (patch)
tree43ce8eed4d26beb6f2acff2279c43eae7f79f83a /fs/xfs/xfs_iomap.c
parent03e01349c654fbdea80d3d9b4ab599244eb55bb7 (diff)
parent2451337dd043901b5270b7586942abe564443e3d (diff)
Merge branch 'xfs-libxfs-restructure' into for-next
Diffstat (limited to 'fs/xfs/xfs_iomap.c')
-rw-r--r--fs/xfs/xfs_iomap.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 6d3ec2b6ee29..17400f0f076c 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -110,7 +110,7 @@ xfs_alert_fsblock_zero(
110 (unsigned long long)imap->br_startoff, 110 (unsigned long long)imap->br_startoff,
111 (unsigned long long)imap->br_blockcount, 111 (unsigned long long)imap->br_blockcount,
112 imap->br_state); 112 imap->br_state);
113 return EFSCORRUPTED; 113 return -EFSCORRUPTED;
114} 114}
115 115
116int 116int
@@ -138,7 +138,7 @@ xfs_iomap_write_direct(
138 138
139 error = xfs_qm_dqattach(ip, 0); 139 error = xfs_qm_dqattach(ip, 0);
140 if (error) 140 if (error)
141 return XFS_ERROR(error); 141 return error;
142 142
143 rt = XFS_IS_REALTIME_INODE(ip); 143 rt = XFS_IS_REALTIME_INODE(ip);
144 extsz = xfs_get_extsz_hint(ip); 144 extsz = xfs_get_extsz_hint(ip);
@@ -148,7 +148,7 @@ xfs_iomap_write_direct(
148 if ((offset + count) > XFS_ISIZE(ip)) { 148 if ((offset + count) > XFS_ISIZE(ip)) {
149 error = xfs_iomap_eof_align_last_fsb(mp, ip, extsz, &last_fsb); 149 error = xfs_iomap_eof_align_last_fsb(mp, ip, extsz, &last_fsb);
150 if (error) 150 if (error)
151 return XFS_ERROR(error); 151 return error;
152 } else { 152 } else {
153 if (nmaps && (imap->br_startblock == HOLESTARTBLOCK)) 153 if (nmaps && (imap->br_startblock == HOLESTARTBLOCK))
154 last_fsb = MIN(last_fsb, (xfs_fileoff_t) 154 last_fsb = MIN(last_fsb, (xfs_fileoff_t)
@@ -188,7 +188,7 @@ xfs_iomap_write_direct(
188 */ 188 */
189 if (error) { 189 if (error) {
190 xfs_trans_cancel(tp, 0); 190 xfs_trans_cancel(tp, 0);
191 return XFS_ERROR(error); 191 return error;
192 } 192 }
193 193
194 xfs_ilock(ip, XFS_ILOCK_EXCL); 194 xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -225,7 +225,7 @@ xfs_iomap_write_direct(
225 * Copy any maps to caller's array and return any error. 225 * Copy any maps to caller's array and return any error.
226 */ 226 */
227 if (nimaps == 0) { 227 if (nimaps == 0) {
228 error = XFS_ERROR(ENOSPC); 228 error = -ENOSPC;
229 goto out_unlock; 229 goto out_unlock;
230 } 230 }
231 231
@@ -552,7 +552,7 @@ xfs_iomap_write_delay(
552 */ 552 */
553 error = xfs_qm_dqattach_locked(ip, 0); 553 error = xfs_qm_dqattach_locked(ip, 0);
554 if (error) 554 if (error)
555 return XFS_ERROR(error); 555 return error;
556 556
557 extsz = xfs_get_extsz_hint(ip); 557 extsz = xfs_get_extsz_hint(ip);
558 offset_fsb = XFS_B_TO_FSBT(mp, offset); 558 offset_fsb = XFS_B_TO_FSBT(mp, offset);
@@ -596,11 +596,11 @@ retry:
596 imap, &nimaps, XFS_BMAPI_ENTIRE); 596 imap, &nimaps, XFS_BMAPI_ENTIRE);
597 switch (error) { 597 switch (error) {
598 case 0: 598 case 0:
599 case ENOSPC: 599 case -ENOSPC:
600 case EDQUOT: 600 case -EDQUOT:
601 break; 601 break;
602 default: 602 default:
603 return XFS_ERROR(error); 603 return error;
604 } 604 }
605 605
606 /* 606 /*
@@ -614,7 +614,7 @@ retry:
614 error = 0; 614 error = 0;
615 goto retry; 615 goto retry;
616 } 616 }
617 return XFS_ERROR(error ? error : ENOSPC); 617 return error ? error : -ENOSPC;
618 } 618 }
619 619
620 if (!(imap[0].br_startblock || XFS_IS_REALTIME_INODE(ip))) 620 if (!(imap[0].br_startblock || XFS_IS_REALTIME_INODE(ip)))
@@ -663,7 +663,7 @@ xfs_iomap_write_allocate(
663 */ 663 */
664 error = xfs_qm_dqattach(ip, 0); 664 error = xfs_qm_dqattach(ip, 0);
665 if (error) 665 if (error)
666 return XFS_ERROR(error); 666 return error;
667 667
668 offset_fsb = XFS_B_TO_FSBT(mp, offset); 668 offset_fsb = XFS_B_TO_FSBT(mp, offset);
669 count_fsb = imap->br_blockcount; 669 count_fsb = imap->br_blockcount;
@@ -690,7 +690,7 @@ xfs_iomap_write_allocate(
690 nres, 0); 690 nres, 0);
691 if (error) { 691 if (error) {
692 xfs_trans_cancel(tp, 0); 692 xfs_trans_cancel(tp, 0);
693 return XFS_ERROR(error); 693 return error;
694 } 694 }
695 xfs_ilock(ip, XFS_ILOCK_EXCL); 695 xfs_ilock(ip, XFS_ILOCK_EXCL);
696 xfs_trans_ijoin(tp, ip, 0); 696 xfs_trans_ijoin(tp, ip, 0);
@@ -739,7 +739,7 @@ xfs_iomap_write_allocate(
739 if ((map_start_fsb + count_fsb) > last_block) { 739 if ((map_start_fsb + count_fsb) > last_block) {
740 count_fsb = last_block - map_start_fsb; 740 count_fsb = last_block - map_start_fsb;
741 if (count_fsb == 0) { 741 if (count_fsb == 0) {
742 error = EAGAIN; 742 error = -EAGAIN;
743 goto trans_cancel; 743 goto trans_cancel;
744 } 744 }
745 } 745 }
@@ -793,7 +793,7 @@ trans_cancel:
793 xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT); 793 xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT);
794error0: 794error0:
795 xfs_iunlock(ip, XFS_ILOCK_EXCL); 795 xfs_iunlock(ip, XFS_ILOCK_EXCL);
796 return XFS_ERROR(error); 796 return error;
797} 797}
798 798
799int 799int
@@ -853,7 +853,7 @@ xfs_iomap_write_unwritten(
853 resblks, 0); 853 resblks, 0);
854 if (error) { 854 if (error) {
855 xfs_trans_cancel(tp, 0); 855 xfs_trans_cancel(tp, 0);
856 return XFS_ERROR(error); 856 return error;
857 } 857 }
858 858
859 xfs_ilock(ip, XFS_ILOCK_EXCL); 859 xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -892,7 +892,7 @@ xfs_iomap_write_unwritten(
892 error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); 892 error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
893 xfs_iunlock(ip, XFS_ILOCK_EXCL); 893 xfs_iunlock(ip, XFS_ILOCK_EXCL);
894 if (error) 894 if (error)
895 return XFS_ERROR(error); 895 return error;
896 896
897 if (!(imap.br_startblock || XFS_IS_REALTIME_INODE(ip))) 897 if (!(imap.br_startblock || XFS_IS_REALTIME_INODE(ip)))
898 return xfs_alert_fsblock_zero(ip, &imap); 898 return xfs_alert_fsblock_zero(ip, &imap);
@@ -915,5 +915,5 @@ error_on_bmapi_transaction:
915 xfs_bmap_cancel(&free_list); 915 xfs_bmap_cancel(&free_list);
916 xfs_trans_cancel(tp, (XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT)); 916 xfs_trans_cancel(tp, (XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT));
917 xfs_iunlock(ip, XFS_ILOCK_EXCL); 917 xfs_iunlock(ip, XFS_ILOCK_EXCL);
918 return XFS_ERROR(error); 918 return error;
919} 919}