@@ -53,7 +53,8 @@ xfs_bmbt_to_iomap(
53
53
struct xfs_inode * ip ,
54
54
struct iomap * iomap ,
55
55
struct xfs_bmbt_irec * imap ,
56
- u16 flags )
56
+ unsigned int mapping_flags ,
57
+ u16 iomap_flags )
57
58
{
58
59
struct xfs_mount * mp = ip -> i_mount ;
59
60
struct xfs_buftarg * target = xfs_inode_buftarg (ip );
@@ -79,7 +80,7 @@ xfs_bmbt_to_iomap(
79
80
iomap -> length = XFS_FSB_TO_B (mp , imap -> br_blockcount );
80
81
iomap -> bdev = target -> bt_bdev ;
81
82
iomap -> dax_dev = target -> bt_daxdev ;
82
- iomap -> flags = flags ;
83
+ iomap -> flags = iomap_flags ;
83
84
84
85
if (xfs_ipincount (ip ) &&
85
86
(ip -> i_itemp -> ili_fsync_fields & ~XFS_ILOG_TIMESTAMP ))
@@ -799,7 +800,7 @@ xfs_direct_write_iomap_begin(
799
800
800
801
xfs_iunlock (ip , lockmode );
801
802
trace_xfs_iomap_found (ip , offset , length , XFS_DATA_FORK , & imap );
802
- return xfs_bmbt_to_iomap (ip , iomap , & imap , iomap_flags );
803
+ return xfs_bmbt_to_iomap (ip , iomap , & imap , flags , iomap_flags );
803
804
804
805
allocate_blocks :
805
806
error = - EAGAIN ;
@@ -830,18 +831,19 @@ xfs_direct_write_iomap_begin(
830
831
return error ;
831
832
832
833
trace_xfs_iomap_alloc (ip , offset , length , XFS_DATA_FORK , & imap );
833
- return xfs_bmbt_to_iomap (ip , iomap , & imap , iomap_flags | IOMAP_F_NEW );
834
+ return xfs_bmbt_to_iomap (ip , iomap , & imap , flags ,
835
+ iomap_flags | IOMAP_F_NEW );
834
836
835
837
out_found_cow :
836
838
xfs_iunlock (ip , lockmode );
837
839
length = XFS_FSB_TO_B (mp , cmap .br_startoff + cmap .br_blockcount );
838
840
trace_xfs_iomap_found (ip , offset , length - offset , XFS_COW_FORK , & cmap );
839
841
if (imap .br_startblock != HOLESTARTBLOCK ) {
840
- error = xfs_bmbt_to_iomap (ip , srcmap , & imap , 0 );
842
+ error = xfs_bmbt_to_iomap (ip , srcmap , & imap , flags , 0 );
841
843
if (error )
842
844
return error ;
843
845
}
844
- return xfs_bmbt_to_iomap (ip , iomap , & cmap , IOMAP_F_SHARED );
846
+ return xfs_bmbt_to_iomap (ip , iomap , & cmap , flags , IOMAP_F_SHARED );
845
847
846
848
out_unlock :
847
849
if (lockmode )
@@ -1051,23 +1053,24 @@ xfs_buffered_write_iomap_begin(
1051
1053
*/
1052
1054
xfs_iunlock (ip , XFS_ILOCK_EXCL );
1053
1055
trace_xfs_iomap_alloc (ip , offset , count , allocfork , & imap );
1054
- return xfs_bmbt_to_iomap (ip , iomap , & imap , IOMAP_F_NEW );
1056
+ return xfs_bmbt_to_iomap (ip , iomap , & imap , flags , IOMAP_F_NEW );
1055
1057
1056
1058
found_imap :
1057
1059
xfs_iunlock (ip , XFS_ILOCK_EXCL );
1058
- return xfs_bmbt_to_iomap (ip , iomap , & imap , 0 );
1060
+ return xfs_bmbt_to_iomap (ip , iomap , & imap , flags , 0 );
1059
1061
1060
1062
found_cow :
1061
1063
xfs_iunlock (ip , XFS_ILOCK_EXCL );
1062
1064
if (imap .br_startoff <= offset_fsb ) {
1063
- error = xfs_bmbt_to_iomap (ip , srcmap , & imap , 0 );
1065
+ error = xfs_bmbt_to_iomap (ip , srcmap , & imap , flags , 0 );
1064
1066
if (error )
1065
1067
return error ;
1066
- return xfs_bmbt_to_iomap (ip , iomap , & cmap , IOMAP_F_SHARED );
1068
+ return xfs_bmbt_to_iomap (ip , iomap , & cmap , flags ,
1069
+ IOMAP_F_SHARED );
1067
1070
}
1068
1071
1069
1072
xfs_trim_extent (& cmap , offset_fsb , imap .br_startoff - offset_fsb );
1070
- return xfs_bmbt_to_iomap (ip , iomap , & cmap , 0 );
1073
+ return xfs_bmbt_to_iomap (ip , iomap , & cmap , flags , 0 );
1071
1074
1072
1075
out_unlock :
1073
1076
xfs_iunlock (ip , XFS_ILOCK_EXCL );
@@ -1176,7 +1179,8 @@ xfs_read_iomap_begin(
1176
1179
if (error )
1177
1180
return error ;
1178
1181
trace_xfs_iomap_found (ip , offset , length , XFS_DATA_FORK , & imap );
1179
- return xfs_bmbt_to_iomap (ip , iomap , & imap , shared ? IOMAP_F_SHARED : 0 );
1182
+ return xfs_bmbt_to_iomap (ip , iomap , & imap , flags ,
1183
+ shared ? IOMAP_F_SHARED : 0 );
1180
1184
}
1181
1185
1182
1186
const struct iomap_ops xfs_read_iomap_ops = {
@@ -1235,7 +1239,8 @@ xfs_seek_iomap_begin(
1235
1239
if (data_fsb < cow_fsb + cmap .br_blockcount )
1236
1240
end_fsb = min (end_fsb , data_fsb );
1237
1241
xfs_trim_extent (& cmap , offset_fsb , end_fsb );
1238
- error = xfs_bmbt_to_iomap (ip , iomap , & cmap , IOMAP_F_SHARED );
1242
+ error = xfs_bmbt_to_iomap (ip , iomap , & cmap , flags ,
1243
+ IOMAP_F_SHARED );
1239
1244
/*
1240
1245
* This is a COW extent, so we must probe the page cache
1241
1246
* because there could be dirty page cache being backed
@@ -1257,7 +1262,7 @@ xfs_seek_iomap_begin(
1257
1262
imap .br_state = XFS_EXT_NORM ;
1258
1263
done :
1259
1264
xfs_trim_extent (& imap , offset_fsb , end_fsb );
1260
- error = xfs_bmbt_to_iomap (ip , iomap , & imap , 0 );
1265
+ error = xfs_bmbt_to_iomap (ip , iomap , & imap , flags , 0 );
1261
1266
out_unlock :
1262
1267
xfs_iunlock (ip , lockmode );
1263
1268
return error ;
@@ -1304,7 +1309,7 @@ xfs_xattr_iomap_begin(
1304
1309
if (error )
1305
1310
return error ;
1306
1311
ASSERT (nimaps );
1307
- return xfs_bmbt_to_iomap (ip , iomap , & imap , 0 );
1312
+ return xfs_bmbt_to_iomap (ip , iomap , & imap , flags , 0 );
1308
1313
}
1309
1314
1310
1315
const struct iomap_ops xfs_xattr_iomap_ops = {
0 commit comments