Lines Matching refs:mp
45 #define XFS_WRITEIO_ALIGN(mp,off) (((off) >> mp->m_writeio_log) \ argument
46 << mp->m_writeio_log)
54 struct xfs_mount *mp = ip->i_mount; in xfs_bmbt_to_iomap() local
69 iomap->offset = XFS_FSB_TO_B(mp, imap->br_startoff); in xfs_bmbt_to_iomap()
70 iomap->length = XFS_FSB_TO_B(mp, imap->br_blockcount); in xfs_bmbt_to_iomap()
80 struct xfs_mount *mp = ip->i_mount; in xfs_eof_alignment() local
92 if (mp->m_swidth && (mp->m_flags & XFS_MOUNT_SWALLOC)) in xfs_eof_alignment()
93 align = mp->m_swidth; in xfs_eof_alignment()
94 else if (mp->m_dalign) in xfs_eof_alignment()
95 align = mp->m_dalign; in xfs_eof_alignment()
97 if (align && XFS_ISIZE(ip) < XFS_FSB_TO_B(mp, align)) in xfs_eof_alignment()
161 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_direct() local
184 offset_fsb = XFS_B_TO_FSBT(mp, offset); in xfs_iomap_write_direct()
185 last_fsb = XFS_B_TO_FSB(mp, ((xfs_ufsize_t)(offset + count))); in xfs_iomap_write_direct()
211 resrtextents /= mp->m_sb.sb_rextsize; in xfs_iomap_write_direct()
212 resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0); in xfs_iomap_write_direct()
216 resblks = qblocks = XFS_DIOSTRAT_SPACE_RES(mp, resaligned); in xfs_iomap_write_direct()
246 resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0) << 1; in xfs_iomap_write_direct()
249 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, resblks, resrtextents, in xfs_iomap_write_direct()
394 struct xfs_mount *mp = ip->i_mount; in xfs_iomap_prealloc_size() local
396 xfs_fileoff_t offset_fsb = XFS_B_TO_FSBT(mp, offset); in xfs_iomap_prealloc_size()
407 if (!(mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) && in xfs_iomap_prealloc_size()
408 (XFS_ISIZE(ip) < XFS_FSB_TO_B(mp, mp->m_writeio_blocks))) in xfs_iomap_prealloc_size()
415 if ((mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) || in xfs_iomap_prealloc_size()
416 XFS_ISIZE(ip) < XFS_FSB_TO_B(mp, mp->m_dalign) || in xfs_iomap_prealloc_size()
419 return mp->m_writeio_blocks; in xfs_iomap_prealloc_size()
440 alloc_blocks = XFS_B_TO_FSB(mp, offset); in xfs_iomap_prealloc_size()
455 freesp = percpu_counter_read_positive(&mp->m_fdblocks); in xfs_iomap_prealloc_size()
456 if (freesp < mp->m_low_space[XFS_LOWSP_5_PCNT]) { in xfs_iomap_prealloc_size()
458 if (freesp < mp->m_low_space[XFS_LOWSP_4_PCNT]) in xfs_iomap_prealloc_size()
460 if (freesp < mp->m_low_space[XFS_LOWSP_3_PCNT]) in xfs_iomap_prealloc_size()
462 if (freesp < mp->m_low_space[XFS_LOWSP_2_PCNT]) in xfs_iomap_prealloc_size()
464 if (freesp < mp->m_low_space[XFS_LOWSP_1_PCNT]) in xfs_iomap_prealloc_size()
512 if (alloc_blocks < mp->m_writeio_blocks) in xfs_iomap_prealloc_size()
513 alloc_blocks = mp->m_writeio_blocks; in xfs_iomap_prealloc_size()
515 mp->m_writeio_blocks); in xfs_iomap_prealloc_size()
527 struct xfs_mount *mp = ip->i_mount; in xfs_file_iomap_begin_delay() local
529 xfs_fileoff_t offset_fsb = XFS_B_TO_FSBT(mp, offset); in xfs_file_iomap_begin_delay()
531 XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes); in xfs_file_iomap_begin_delay()
546 mp, XFS_ERRTAG_BMAPIFORMAT))) { in xfs_file_iomap_begin_delay()
547 XFS_ERROR_REPORT(__func__, XFS_ERRLEVEL_LOW, mp); in xfs_file_iomap_begin_delay()
552 XFS_STATS_INC(mp, xs_blk_mapw); in xfs_file_iomap_begin_delay()
565 end_fsb = min(XFS_B_TO_FSB(mp, offset + count), in xfs_file_iomap_begin_delay()
591 end_fsb = min(XFS_B_TO_FSB(mp, offset + count), maxbytes_fsb); in xfs_file_iomap_begin_delay()
600 end_offset = XFS_WRITEIO_ALIGN(mp, offset + count - 1); in xfs_file_iomap_begin_delay()
601 p_end_fsb = XFS_B_TO_FSBT(mp, end_offset) + in xfs_file_iomap_begin_delay()
673 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_allocate() local
695 offset_fsb = XFS_B_TO_FSBT(mp, offset); in xfs_iomap_write_allocate()
699 XFS_STATS_ADD(mp, xs_xstrat_bytes, XFS_FSB_TO_B(mp, count_fsb)); in xfs_iomap_write_allocate()
712 nres = XFS_EXTENTADD_SPACE_RES(mp, XFS_DATA_FORK); in xfs_iomap_write_allocate()
719 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, 0, in xfs_iomap_write_allocate()
761 end_fsb = XFS_B_TO_FSB(mp, XFS_ISIZE(ip)); in xfs_iomap_write_allocate()
808 XFS_STATS_INC(mp, xs_xstrat_quick); in xfs_iomap_write_allocate()
835 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_unwritten() local
851 offset_fsb = XFS_B_TO_FSBT(mp, offset); in xfs_iomap_write_unwritten()
852 count_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + count); in xfs_iomap_write_unwritten()
865 resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0) << 1; in xfs_iomap_write_unwritten()
877 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, resblks, 0, in xfs_iomap_write_unwritten()
901 i_size = XFS_FSB_TO_B(mp, offset_fsb + count_fsb); in xfs_iomap_write_unwritten()
976 struct xfs_mount *mp = ip->i_mount; in xfs_file_iomap_begin() local
983 if (XFS_FORCED_SHUTDOWN(mp)) in xfs_file_iomap_begin()
1004 ASSERT(offset <= mp->m_super->s_maxbytes); in xfs_file_iomap_begin()
1005 if ((xfs_fsize_t)offset + length > mp->m_super->s_maxbytes) in xfs_file_iomap_begin()
1006 length = mp->m_super->s_maxbytes - offset; in xfs_file_iomap_begin()
1007 offset_fsb = XFS_B_TO_FSBT(mp, offset); in xfs_file_iomap_begin()
1008 end_fsb = XFS_B_TO_FSB(mp, offset + length); in xfs_file_iomap_begin()
1046 length = XFS_FSB_TO_B(mp, end_fsb) - offset; in xfs_file_iomap_begin()
1107 struct xfs_mount *mp = ip->i_mount; in xfs_file_iomap_end_delalloc() local
1116 if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_DROP_WRITES)) { in xfs_file_iomap_end_delalloc()
1127 start_fsb = XFS_B_TO_FSBT(mp, offset); in xfs_file_iomap_end_delalloc()
1129 start_fsb = XFS_B_TO_FSB(mp, offset + written); in xfs_file_iomap_end_delalloc()
1130 end_fsb = XFS_B_TO_FSB(mp, offset + length); in xfs_file_iomap_end_delalloc()
1141 truncate_pagecache_range(VFS_I(ip), XFS_FSB_TO_B(mp, start_fsb), in xfs_file_iomap_end_delalloc()
1142 XFS_FSB_TO_B(mp, end_fsb) - 1); in xfs_file_iomap_end_delalloc()
1149 if (error && !XFS_FORCED_SHUTDOWN(mp)) { in xfs_file_iomap_end_delalloc()
1150 xfs_alert(mp, "%s: unable to clean up ino %lld", in xfs_file_iomap_end_delalloc()
1188 struct xfs_mount *mp = ip->i_mount; in xfs_xattr_iomap_begin() local
1189 xfs_fileoff_t offset_fsb = XFS_B_TO_FSBT(mp, offset); in xfs_xattr_iomap_begin()
1190 xfs_fileoff_t end_fsb = XFS_B_TO_FSB(mp, offset + length); in xfs_xattr_iomap_begin()
1195 if (XFS_FORCED_SHUTDOWN(mp)) in xfs_xattr_iomap_begin()