Lines Matching full:mp

47 	struct xfs_mount	*mp = tp->t_mountp;  in xfs_resizefs_init_new_ags()  local
48 xfs_rfsblock_t nb = mp->m_sb.sb_dblocks + delta; in xfs_resizefs_init_new_ags()
60 (xfs_rfsblock_t)mp->m_sb.sb_agblocks); in xfs_resizefs_init_new_ags()
62 id->agsize = mp->m_sb.sb_agblocks; in xfs_resizefs_init_new_ags()
64 error = xfs_ag_init_headers(mp, id); in xfs_resizefs_init_new_ags()
87 struct xfs_mount *mp, /* mount point for filesystem */ in xfs_growfs_data_private() argument
90 xfs_agnumber_t oagcount = mp->m_sb.sb_agcount; in xfs_growfs_data_private()
103 error = xfs_sb_validate_fsb_count(&mp->m_sb, nb); in xfs_growfs_data_private()
107 if (nb > mp->m_sb.sb_dblocks) { in xfs_growfs_data_private()
108 error = xfs_buf_read_uncached(mp->m_ddev_targp, in xfs_growfs_data_private()
109 XFS_FSB_TO_BB(mp, nb) - XFS_FSS_TO_BB(mp, 1), in xfs_growfs_data_private()
110 XFS_FSS_TO_BB(mp, 1), 0, &bp, NULL); in xfs_growfs_data_private()
117 nb_mod = do_div(nb_div, mp->m_sb.sb_agblocks); in xfs_growfs_data_private()
121 nb = nb_div * mp->m_sb.sb_agblocks; in xfs_growfs_data_private()
125 nb = nb_div * mp->m_sb.sb_agblocks; in xfs_growfs_data_private()
128 delta = nb - mp->m_sb.sb_dblocks; in xfs_growfs_data_private()
146 error = xfs_initialize_perag(mp, oagcount, nagcount, nb, &nagimax); in xfs_growfs_data_private()
151 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growdata, in xfs_growfs_data_private()
152 XFS_GROWFS_SPACE_RES(mp), 0, XFS_TRANS_RESERVE, in xfs_growfs_data_private()
155 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growdata, -delta, 0, in xfs_growfs_data_private()
160 last_pag = xfs_perag_get(mp, oagcount - 1); in xfs_growfs_data_private()
165 xfs_warn_mount(mp, XFS_OPSTATE_WARNED_SHRINK, in xfs_growfs_data_private()
191 if (xfs_has_lazysbcount(mp)) in xfs_growfs_data_private()
201 mp->m_maxagi = nagimax; in xfs_growfs_data_private()
202 xfs_set_low_space_thresholds(mp); in xfs_growfs_data_private()
203 mp->m_alloc_set_aside = xfs_alloc_set_aside(mp); in xfs_growfs_data_private()
213 pag = xfs_perag_get(mp, id.agno); in xfs_growfs_data_private()
222 error = xfs_fs_reserve_ag_blocks(mp); in xfs_growfs_data_private()
232 xfs_free_perag_range(mp, oagcount, nagcount); in xfs_growfs_data_private()
238 struct xfs_mount *mp, /* mount point for filesystem */ in xfs_growfs_log_private() argument
244 if (nb < XFS_MIN_LOG_BLOCKS || nb < XFS_B_TO_FSB(mp, XFS_MIN_LOG_BYTES)) in xfs_growfs_log_private()
246 if (nb == mp->m_sb.sb_logblocks && in xfs_growfs_log_private()
247 in->isint == (mp->m_sb.sb_logstart != 0)) in xfs_growfs_log_private()
260 struct xfs_mount *mp, in xfs_growfs_imaxpct() argument
270 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growdata, in xfs_growfs_imaxpct()
271 XFS_GROWFS_SPACE_RES(mp), 0, XFS_TRANS_RESERVE, &tp); in xfs_growfs_imaxpct()
275 dpct = imaxpct - mp->m_sb.sb_imax_pct; in xfs_growfs_imaxpct()
288 struct xfs_mount *mp, in xfs_growfs_data() argument
295 if (!mutex_trylock(&mp->m_growlock)) in xfs_growfs_data()
299 if (in->imaxpct != mp->m_sb.sb_imax_pct) { in xfs_growfs_data()
300 error = xfs_growfs_imaxpct(mp, in->imaxpct); in xfs_growfs_data()
305 if (in->newblocks != mp->m_sb.sb_dblocks) { in xfs_growfs_data()
306 error = xfs_growfs_data_private(mp, in); in xfs_growfs_data()
312 if (mp->m_sb.sb_imax_pct) { in xfs_growfs_data()
313 uint64_t icount = mp->m_sb.sb_dblocks * mp->m_sb.sb_imax_pct; in xfs_growfs_data()
315 M_IGEO(mp)->maxicount = XFS_FSB_TO_INO(mp, icount); in xfs_growfs_data()
317 M_IGEO(mp)->maxicount = 0; in xfs_growfs_data()
320 error = xfs_update_secondary_sbs(mp); in xfs_growfs_data()
328 mp->m_generation++; in xfs_growfs_data()
329 mutex_unlock(&mp->m_growlock); in xfs_growfs_data()
335 xfs_mount_t *mp, in xfs_growfs_log() argument
342 if (!mutex_trylock(&mp->m_growlock)) in xfs_growfs_log()
344 error = xfs_growfs_log_private(mp, in); in xfs_growfs_log()
345 mutex_unlock(&mp->m_growlock); in xfs_growfs_log()
356 struct xfs_mount *mp, in xfs_reserve_blocks() argument
374 spin_lock(&mp->m_sb_lock); in xfs_reserve_blocks()
382 if (mp->m_resblks > request) { in xfs_reserve_blocks()
383 lcounter = mp->m_resblks_avail - request; in xfs_reserve_blocks()
386 mp->m_resblks_avail -= lcounter; in xfs_reserve_blocks()
388 mp->m_resblks = request; in xfs_reserve_blocks()
390 spin_unlock(&mp->m_sb_lock); in xfs_reserve_blocks()
391 xfs_add_fdblocks(mp, fdblks_delta); in xfs_reserve_blocks()
392 spin_lock(&mp->m_sb_lock); in xfs_reserve_blocks()
410 free = percpu_counter_sum(&mp->m_fdblocks) - in xfs_reserve_blocks()
411 xfs_fdblocks_unavailable(mp); in xfs_reserve_blocks()
412 delta = request - mp->m_resblks; in xfs_reserve_blocks()
413 mp->m_resblks = request; in xfs_reserve_blocks()
426 spin_unlock(&mp->m_sb_lock); in xfs_reserve_blocks()
427 error = xfs_dec_fdblocks(mp, fdblks_delta, 0); in xfs_reserve_blocks()
429 xfs_add_fdblocks(mp, fdblks_delta); in xfs_reserve_blocks()
430 spin_lock(&mp->m_sb_lock); in xfs_reserve_blocks()
433 spin_unlock(&mp->m_sb_lock); in xfs_reserve_blocks()
439 xfs_mount_t *mp, in xfs_fs_goingdown() argument
444 if (!bdev_freeze(mp->m_super->s_bdev)) { in xfs_fs_goingdown()
445 xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT); in xfs_fs_goingdown()
446 bdev_thaw(mp->m_super->s_bdev); in xfs_fs_goingdown()
451 xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT); in xfs_fs_goingdown()
454 xfs_force_shutdown(mp, in xfs_fs_goingdown()
477 struct xfs_mount *mp, in xfs_do_force_shutdown() argument
486 if (xfs_set_shutdown(mp)) { in xfs_do_force_shutdown()
487 xlog_shutdown_wait(mp->m_log); in xfs_do_force_shutdown()
490 if (mp->m_sb_bp) in xfs_do_force_shutdown()
491 mp->m_sb_bp->b_flags |= XBF_DONE; in xfs_do_force_shutdown()
494 xfs_alert(mp, "User initiated shutdown received."); in xfs_do_force_shutdown()
496 if (xlog_force_shutdown(mp->m_log, flags)) { in xfs_do_force_shutdown()
513 trace_xfs_force_shutdown(mp, tag, flags, fname, lnnum); in xfs_do_force_shutdown()
515 xfs_alert_tag(mp, tag, in xfs_do_force_shutdown()
518 xfs_alert(mp, in xfs_do_force_shutdown()
529 struct xfs_mount *mp) in xfs_fs_reserve_ag_blocks() argument
536 mp->m_finobt_nores = false; in xfs_fs_reserve_ag_blocks()
537 for_each_perag(mp, agno, pag) { in xfs_fs_reserve_ag_blocks()
544 xfs_warn(mp, in xfs_fs_reserve_ag_blocks()
546 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_fs_reserve_ag_blocks()
557 struct xfs_mount *mp) in xfs_fs_unreserve_ag_blocks() argument
562 for_each_perag(mp, agno, pag) in xfs_fs_unreserve_ag_blocks()