Lines Matching refs:mp
32 xfs_mount_t *mp, /* mount point for filesystem */ in xfs_growfs_data_private() argument
47 if (nb < mp->m_sb.sb_dblocks) in xfs_growfs_data_private()
49 if ((error = xfs_sb_validate_fsb_count(&mp->m_sb, nb))) in xfs_growfs_data_private()
51 error = xfs_buf_read_uncached(mp->m_ddev_targp, in xfs_growfs_data_private()
52 XFS_FSB_TO_BB(mp, nb) - XFS_FSS_TO_BB(mp, 1), in xfs_growfs_data_private()
53 XFS_FSS_TO_BB(mp, 1), 0, &bp, NULL); in xfs_growfs_data_private()
59 nb_mod = do_div(new, mp->m_sb.sb_agblocks); in xfs_growfs_data_private()
63 nb = (xfs_rfsblock_t)nagcount * mp->m_sb.sb_agblocks; in xfs_growfs_data_private()
64 if (nb < mp->m_sb.sb_dblocks) in xfs_growfs_data_private()
67 new = nb - mp->m_sb.sb_dblocks; in xfs_growfs_data_private()
68 oagcount = mp->m_sb.sb_agcount; in xfs_growfs_data_private()
72 error = xfs_initialize_perag(mp, nagcount, &nagimax); in xfs_growfs_data_private()
77 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growdata, in xfs_growfs_data_private()
78 XFS_GROWFS_SPACE_RES(mp), 0, XFS_TRANS_RESERVE, &tp); in xfs_growfs_data_private()
101 (id.agno * (xfs_rfsblock_t)mp->m_sb.sb_agblocks); in xfs_growfs_data_private()
103 id.agsize = mp->m_sb.sb_agblocks; in xfs_growfs_data_private()
105 error = xfs_ag_init_headers(mp, &id); in xfs_growfs_data_private()
119 error = xfs_ag_extend_space(mp, tp, &id, new); in xfs_growfs_data_private()
131 if (nb > mp->m_sb.sb_dblocks) in xfs_growfs_data_private()
133 nb - mp->m_sb.sb_dblocks); in xfs_growfs_data_private()
143 mp->m_maxagi = nagimax; in xfs_growfs_data_private()
144 xfs_set_low_space_thresholds(mp); in xfs_growfs_data_private()
145 mp->m_alloc_set_aside = xfs_alloc_set_aside(mp); in xfs_growfs_data_private()
154 pag = xfs_perag_get(mp, id.agno); in xfs_growfs_data_private()
166 error = xfs_fs_reserve_ag_blocks(mp); in xfs_growfs_data_private()
178 xfs_mount_t *mp, /* mount point for filesystem */ in xfs_growfs_log_private() argument
184 if (nb < XFS_MIN_LOG_BLOCKS || nb < XFS_B_TO_FSB(mp, XFS_MIN_LOG_BYTES)) in xfs_growfs_log_private()
186 if (nb == mp->m_sb.sb_logblocks && in xfs_growfs_log_private()
187 in->isint == (mp->m_sb.sb_logstart != 0)) in xfs_growfs_log_private()
200 struct xfs_mount *mp, in xfs_growfs_imaxpct() argument
210 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_growdata, in xfs_growfs_imaxpct()
211 XFS_GROWFS_SPACE_RES(mp), 0, XFS_TRANS_RESERVE, &tp); in xfs_growfs_imaxpct()
215 dpct = imaxpct - mp->m_sb.sb_imax_pct; in xfs_growfs_imaxpct()
228 struct xfs_mount *mp, in xfs_growfs_data() argument
235 if (!mutex_trylock(&mp->m_growlock)) in xfs_growfs_data()
239 if (in->imaxpct != mp->m_sb.sb_imax_pct) { in xfs_growfs_data()
240 error = xfs_growfs_imaxpct(mp, in->imaxpct); in xfs_growfs_data()
245 if (in->newblocks != mp->m_sb.sb_dblocks) { in xfs_growfs_data()
246 error = xfs_growfs_data_private(mp, in); in xfs_growfs_data()
252 if (mp->m_sb.sb_imax_pct) { in xfs_growfs_data()
253 uint64_t icount = mp->m_sb.sb_dblocks * mp->m_sb.sb_imax_pct; in xfs_growfs_data()
255 mp->m_maxicount = icount << mp->m_sb.sb_inopblog; in xfs_growfs_data()
257 mp->m_maxicount = 0; in xfs_growfs_data()
260 error = xfs_update_secondary_sbs(mp); in xfs_growfs_data()
268 mp->m_generation++; in xfs_growfs_data()
269 mutex_unlock(&mp->m_growlock); in xfs_growfs_data()
275 xfs_mount_t *mp, in xfs_growfs_log() argument
282 if (!mutex_trylock(&mp->m_growlock)) in xfs_growfs_log()
284 error = xfs_growfs_log_private(mp, in); in xfs_growfs_log()
285 mutex_unlock(&mp->m_growlock); in xfs_growfs_log()
295 xfs_mount_t *mp, in xfs_fs_counts() argument
298 cnt->allocino = percpu_counter_read_positive(&mp->m_icount); in xfs_fs_counts()
299 cnt->freeino = percpu_counter_read_positive(&mp->m_ifree); in xfs_fs_counts()
300 cnt->freedata = percpu_counter_read_positive(&mp->m_fdblocks) - in xfs_fs_counts()
301 mp->m_alloc_set_aside; in xfs_fs_counts()
303 spin_lock(&mp->m_sb_lock); in xfs_fs_counts()
304 cnt->freertx = mp->m_sb.sb_frextents; in xfs_fs_counts()
305 spin_unlock(&mp->m_sb_lock); in xfs_fs_counts()
326 xfs_mount_t *mp, in xfs_reserve_blocks() argument
340 outval->resblks = mp->m_resblks; in xfs_reserve_blocks()
341 outval->resblks_avail = mp->m_resblks_avail; in xfs_reserve_blocks()
357 spin_lock(&mp->m_sb_lock); in xfs_reserve_blocks()
365 if (mp->m_resblks > request) { in xfs_reserve_blocks()
366 lcounter = mp->m_resblks_avail - request; in xfs_reserve_blocks()
369 mp->m_resblks_avail -= lcounter; in xfs_reserve_blocks()
371 mp->m_resblks = request; in xfs_reserve_blocks()
373 spin_unlock(&mp->m_sb_lock); in xfs_reserve_blocks()
374 error = xfs_mod_fdblocks(mp, fdblks_delta, 0); in xfs_reserve_blocks()
375 spin_lock(&mp->m_sb_lock); in xfs_reserve_blocks()
388 free = percpu_counter_sum(&mp->m_fdblocks) - in xfs_reserve_blocks()
389 mp->m_alloc_set_aside; in xfs_reserve_blocks()
393 delta = request - mp->m_resblks; in xfs_reserve_blocks()
411 spin_unlock(&mp->m_sb_lock); in xfs_reserve_blocks()
412 error = xfs_mod_fdblocks(mp, -fdblks_delta, 0); in xfs_reserve_blocks()
413 spin_lock(&mp->m_sb_lock); in xfs_reserve_blocks()
421 mp->m_resblks += fdblks_delta; in xfs_reserve_blocks()
422 mp->m_resblks_avail += fdblks_delta; in xfs_reserve_blocks()
427 outval->resblks = mp->m_resblks; in xfs_reserve_blocks()
428 outval->resblks_avail = mp->m_resblks_avail; in xfs_reserve_blocks()
431 spin_unlock(&mp->m_sb_lock); in xfs_reserve_blocks()
437 xfs_mount_t *mp, in xfs_fs_goingdown() argument
442 struct super_block *sb = freeze_bdev(mp->m_super->s_bdev); in xfs_fs_goingdown()
445 xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT); in xfs_fs_goingdown()
452 xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT); in xfs_fs_goingdown()
455 xfs_force_shutdown(mp, in xfs_fs_goingdown()
473 xfs_mount_t *mp, in xfs_do_force_shutdown() argument
483 xfs_notice(mp, in xfs_do_force_shutdown()
490 if (XFS_FORCED_SHUTDOWN(mp) && !logerror) in xfs_do_force_shutdown()
499 if (xfs_log_force_umount(mp, logerror)) in xfs_do_force_shutdown()
503 xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_CORRUPT, in xfs_do_force_shutdown()
509 xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_LOGERROR, in xfs_do_force_shutdown()
512 xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_IOERROR, in xfs_do_force_shutdown()
515 xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_IOERROR, in xfs_do_force_shutdown()
520 xfs_alert(mp, in xfs_do_force_shutdown()
530 struct xfs_mount *mp) in xfs_fs_reserve_ag_blocks() argument
537 for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) { in xfs_fs_reserve_ag_blocks()
538 pag = xfs_perag_get(mp, agno); in xfs_fs_reserve_ag_blocks()
546 xfs_warn(mp, in xfs_fs_reserve_ag_blocks()
548 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_fs_reserve_ag_blocks()
559 struct xfs_mount *mp) in xfs_fs_unreserve_ag_blocks() argument
566 for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) { in xfs_fs_unreserve_ag_blocks()
567 pag = xfs_perag_get(mp, agno); in xfs_fs_unreserve_ag_blocks()
575 xfs_warn(mp, in xfs_fs_unreserve_ag_blocks()