Lines Matching refs:mp

41 #define XFS_WRITEIO_ALIGN(mp,off)	(((off) >> mp->m_writeio_log) \  argument
42 << mp->m_writeio_log)
47 xfs_mount_t *mp, in xfs_iomap_eof_align_last_fsb() argument
64 if (mp->m_swidth && (mp->m_flags & XFS_MOUNT_SWALLOC)) in xfs_iomap_eof_align_last_fsb()
65 align = mp->m_swidth; in xfs_iomap_eof_align_last_fsb()
66 else if (mp->m_dalign) in xfs_iomap_eof_align_last_fsb()
67 align = mp->m_dalign; in xfs_iomap_eof_align_last_fsb()
69 if (align && XFS_ISIZE(ip) < XFS_FSB_TO_B(mp, align)) in xfs_iomap_eof_align_last_fsb()
120 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_direct() local
143 offset_fsb = XFS_B_TO_FSBT(mp, offset); in xfs_iomap_write_direct()
144 last_fsb = XFS_B_TO_FSB(mp, ((xfs_ufsize_t)(offset + count))); in xfs_iomap_write_direct()
155 error = xfs_iomap_eof_align_last_fsb(mp, ip, extsz, &last_fsb); in xfs_iomap_write_direct()
177 resrtextents /= mp->m_sb.sb_rextsize; in xfs_iomap_write_direct()
178 resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0); in xfs_iomap_write_direct()
182 resblks = qblocks = XFS_DIOSTRAT_SPACE_RES(mp, resaligned); in xfs_iomap_write_direct()
198 tp = xfs_trans_alloc(mp, XFS_TRANS_DIOSTRAT); in xfs_iomap_write_direct()
216 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, in xfs_iomap_write_direct()
291 xfs_mount_t *mp, in xfs_iomap_eof_want_preallocate() argument
313 if (!(mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) && in xfs_iomap_eof_want_preallocate()
314 XFS_ISIZE(ip) < XFS_FSB_TO_B(mp, mp->m_writeio_blocks)) in xfs_iomap_eof_want_preallocate()
321 start_fsb = XFS_B_TO_FSBT(mp, ((xfs_ufsize_t)(offset + count - 1))); in xfs_iomap_eof_want_preallocate()
322 count_fsb = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes); in xfs_iomap_eof_want_preallocate()
362 struct xfs_mount *mp, in xfs_iomap_eof_prealloc_initial_size() argument
375 if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) in xfs_iomap_eof_prealloc_initial_size()
379 if (XFS_ISIZE(ip) < XFS_FSB_TO_B(mp, mp->m_dalign)) in xfs_iomap_eof_prealloc_initial_size()
390 start_fsb = XFS_B_TO_FSB(mp, offset); in xfs_iomap_eof_prealloc_initial_size()
402 return XFS_B_TO_FSB(mp, offset); in xfs_iomap_eof_prealloc_initial_size()
473 struct xfs_mount *mp, in xfs_iomap_prealloc_size() argument
485 alloc_blocks = xfs_iomap_eof_prealloc_initial_size(mp, ip, offset, in xfs_iomap_prealloc_size()
501 freesp = percpu_counter_read_positive(&mp->m_fdblocks); in xfs_iomap_prealloc_size()
502 if (freesp < mp->m_low_space[XFS_LOWSP_5_PCNT]) { in xfs_iomap_prealloc_size()
504 if (freesp < mp->m_low_space[XFS_LOWSP_4_PCNT]) in xfs_iomap_prealloc_size()
506 if (freesp < mp->m_low_space[XFS_LOWSP_3_PCNT]) in xfs_iomap_prealloc_size()
508 if (freesp < mp->m_low_space[XFS_LOWSP_2_PCNT]) in xfs_iomap_prealloc_size()
510 if (freesp < mp->m_low_space[XFS_LOWSP_1_PCNT]) in xfs_iomap_prealloc_size()
559 if (alloc_blocks < mp->m_writeio_blocks) in xfs_iomap_prealloc_size()
560 alloc_blocks = mp->m_writeio_blocks; in xfs_iomap_prealloc_size()
563 mp->m_writeio_blocks); in xfs_iomap_prealloc_size()
575 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_delay() local
597 offset_fsb = XFS_B_TO_FSBT(mp, offset); in xfs_iomap_write_delay()
599 error = xfs_iomap_eof_want_preallocate(mp, ip, offset, count, in xfs_iomap_write_delay()
608 alloc_blocks = xfs_iomap_prealloc_size(mp, ip, offset, imap, in xfs_iomap_write_delay()
611 aligned_offset = XFS_WRITEIO_ALIGN(mp, (offset + count - 1)); in xfs_iomap_write_delay()
612 ioalign = XFS_B_TO_FSBT(mp, aligned_offset); in xfs_iomap_write_delay()
615 last_fsb = XFS_B_TO_FSB(mp, ((xfs_ufsize_t)(offset + count))); in xfs_iomap_write_delay()
619 error = xfs_iomap_eof_align_last_fsb(mp, ip, extsz, &last_fsb); in xfs_iomap_write_delay()
628 if (last_fsb > XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes)) in xfs_iomap_write_delay()
629 last_fsb = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes); in xfs_iomap_write_delay()
689 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_allocate() local
707 offset_fsb = XFS_B_TO_FSBT(mp, offset); in xfs_iomap_write_allocate()
711 XFS_STATS_ADD(mp, xs_xstrat_bytes, XFS_FSB_TO_B(mp, count_fsb)); in xfs_iomap_write_allocate()
725 tp = xfs_trans_alloc(mp, XFS_TRANS_STRAT_WRITE); in xfs_iomap_write_allocate()
727 nres = XFS_EXTENTADD_SPACE_RES(mp, XFS_DATA_FORK); in xfs_iomap_write_allocate()
728 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, in xfs_iomap_write_allocate()
771 end_fsb = XFS_B_TO_FSB(mp, XFS_ISIZE(ip)); in xfs_iomap_write_allocate()
818 XFS_STATS_INC(mp, xs_xstrat_quick); in xfs_iomap_write_allocate()
844 xfs_mount_t *mp = ip->i_mount; in xfs_iomap_write_unwritten() local
860 offset_fsb = XFS_B_TO_FSBT(mp, offset); in xfs_iomap_write_unwritten()
861 count_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)offset + count); in xfs_iomap_write_unwritten()
874 resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0) << 1; in xfs_iomap_write_unwritten()
888 sb_start_intwrite(mp->m_super); in xfs_iomap_write_unwritten()
889 tp = _xfs_trans_alloc(mp, XFS_TRANS_STRAT_WRITE, KM_NOFS); in xfs_iomap_write_unwritten()
891 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_write, in xfs_iomap_write_unwritten()
917 i_size = XFS_FSB_TO_B(mp, offset_fsb + count_fsb); in xfs_iomap_write_unwritten()