• Home
  • Raw
  • Download

Lines Matching refs:mp

55 	xfs_mount_t		*mp,  in xfs_fs_geometry()  argument
59 geo->blocksize = mp->m_sb.sb_blocksize; in xfs_fs_geometry()
60 geo->rtextsize = mp->m_sb.sb_rextsize; in xfs_fs_geometry()
61 geo->agblocks = mp->m_sb.sb_agblocks; in xfs_fs_geometry()
62 geo->agcount = mp->m_sb.sb_agcount; in xfs_fs_geometry()
63 geo->logblocks = mp->m_sb.sb_logblocks; in xfs_fs_geometry()
64 geo->sectsize = mp->m_sb.sb_sectsize; in xfs_fs_geometry()
65 geo->inodesize = mp->m_sb.sb_inodesize; in xfs_fs_geometry()
66 geo->imaxpct = mp->m_sb.sb_imax_pct; in xfs_fs_geometry()
67 geo->datablocks = mp->m_sb.sb_dblocks; in xfs_fs_geometry()
68 geo->rtblocks = mp->m_sb.sb_rblocks; in xfs_fs_geometry()
69 geo->rtextents = mp->m_sb.sb_rextents; in xfs_fs_geometry()
70 geo->logstart = mp->m_sb.sb_logstart; in xfs_fs_geometry()
71 ASSERT(sizeof(geo->uuid)==sizeof(mp->m_sb.sb_uuid)); in xfs_fs_geometry()
72 memcpy(geo->uuid, &mp->m_sb.sb_uuid, sizeof(mp->m_sb.sb_uuid)); in xfs_fs_geometry()
74 geo->sunit = mp->m_sb.sb_unit; in xfs_fs_geometry()
75 geo->swidth = mp->m_sb.sb_width; in xfs_fs_geometry()
80 (xfs_sb_version_hasattr(&mp->m_sb) ? in xfs_fs_geometry()
82 (xfs_sb_version_hasnlink(&mp->m_sb) ? in xfs_fs_geometry()
84 (xfs_sb_version_hasquota(&mp->m_sb) ? in xfs_fs_geometry()
86 (xfs_sb_version_hasalign(&mp->m_sb) ? in xfs_fs_geometry()
88 (xfs_sb_version_hasdalign(&mp->m_sb) ? in xfs_fs_geometry()
90 (xfs_sb_version_hasshared(&mp->m_sb) ? in xfs_fs_geometry()
92 (xfs_sb_version_hasextflgbit(&mp->m_sb) ? in xfs_fs_geometry()
94 (xfs_sb_version_hasdirv2(&mp->m_sb) ? in xfs_fs_geometry()
96 (xfs_sb_version_hassector(&mp->m_sb) ? in xfs_fs_geometry()
98 (xfs_sb_version_hasasciici(&mp->m_sb) ? in xfs_fs_geometry()
100 (xfs_sb_version_haslazysbcount(&mp->m_sb) ? in xfs_fs_geometry()
102 (xfs_sb_version_hasattr2(&mp->m_sb) ? in xfs_fs_geometry()
104 geo->logsectsize = xfs_sb_version_hassector(&mp->m_sb) ? in xfs_fs_geometry()
105 mp->m_sb.sb_logsectsize : BBSIZE; in xfs_fs_geometry()
106 geo->rtsectsize = mp->m_sb.sb_blocksize; in xfs_fs_geometry()
107 geo->dirblocksize = mp->m_dirblksize; in xfs_fs_geometry()
111 (xfs_sb_version_haslogv2(&mp->m_sb) ? in xfs_fs_geometry()
113 geo->logsunit = mp->m_sb.sb_logsunit; in xfs_fs_geometry()
120 xfs_mount_t *mp, /* mount point for filesystem */ in xfs_growfs_data_private() argument
145 if (nb < mp->m_sb.sb_dblocks || pct < 0 || pct > 100) in xfs_growfs_data_private()
147 if ((error = xfs_sb_validate_fsb_count(&mp->m_sb, nb))) in xfs_growfs_data_private()
149 dpct = pct - mp->m_sb.sb_imax_pct; in xfs_growfs_data_private()
150 error = xfs_read_buf(mp, mp->m_ddev_targp, in xfs_growfs_data_private()
151 XFS_FSB_TO_BB(mp, nb) - XFS_FSS_TO_BB(mp, 1), in xfs_growfs_data_private()
152 XFS_FSS_TO_BB(mp, 1), 0, &bp); in xfs_growfs_data_private()
159 nb_mod = do_div(new, mp->m_sb.sb_agblocks); in xfs_growfs_data_private()
163 nb = nagcount * mp->m_sb.sb_agblocks; in xfs_growfs_data_private()
164 if (nb < mp->m_sb.sb_dblocks) in xfs_growfs_data_private()
167 new = nb - mp->m_sb.sb_dblocks; in xfs_growfs_data_private()
168 oagcount = mp->m_sb.sb_agcount; in xfs_growfs_data_private()
170 xfs_filestream_flush(mp); in xfs_growfs_data_private()
171 down_write(&mp->m_peraglock); in xfs_growfs_data_private()
172 mp->m_perag = kmem_realloc(mp->m_perag, in xfs_growfs_data_private()
176 memset(&mp->m_perag[oagcount], 0, in xfs_growfs_data_private()
178 mp->m_flags |= XFS_MOUNT_32BITINODES; in xfs_growfs_data_private()
179 nagimax = xfs_initialize_perag(mp, nagcount); in xfs_growfs_data_private()
180 up_write(&mp->m_peraglock); in xfs_growfs_data_private()
182 tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFS); in xfs_growfs_data_private()
184 if ((error = xfs_trans_reserve(tp, XFS_GROWFS_SPACE_RES(mp), in xfs_growfs_data_private()
185 XFS_GROWDATA_LOG_RES(mp), 0, 0, 0))) { in xfs_growfs_data_private()
195 bp = xfs_buf_get(mp->m_ddev_targp, in xfs_growfs_data_private()
196 XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), in xfs_growfs_data_private()
197 XFS_FSS_TO_BB(mp, 1), 0); in xfs_growfs_data_private()
199 memset(agf, 0, mp->m_sb.sb_sectsize); in xfs_growfs_data_private()
206 (agno * (xfs_rfsblock_t)mp->m_sb.sb_agblocks); in xfs_growfs_data_private()
208 agsize = mp->m_sb.sb_agblocks; in xfs_growfs_data_private()
210 agf->agf_roots[XFS_BTNUM_BNOi] = cpu_to_be32(XFS_BNO_BLOCK(mp)); in xfs_growfs_data_private()
211 agf->agf_roots[XFS_BTNUM_CNTi] = cpu_to_be32(XFS_CNT_BLOCK(mp)); in xfs_growfs_data_private()
215 agf->agf_fllast = cpu_to_be32(XFS_AGFL_SIZE(mp) - 1); in xfs_growfs_data_private()
217 tmpsize = agsize - XFS_PREALLOC_BLOCKS(mp); in xfs_growfs_data_private()
220 error = xfs_bwrite(mp, bp); in xfs_growfs_data_private()
227 bp = xfs_buf_get(mp->m_ddev_targp, in xfs_growfs_data_private()
228 XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), in xfs_growfs_data_private()
229 XFS_FSS_TO_BB(mp, 1), 0); in xfs_growfs_data_private()
231 memset(agi, 0, mp->m_sb.sb_sectsize); in xfs_growfs_data_private()
237 agi->agi_root = cpu_to_be32(XFS_IBT_BLOCK(mp)); in xfs_growfs_data_private()
244 error = xfs_bwrite(mp, bp); in xfs_growfs_data_private()
251 bp = xfs_buf_get(mp->m_ddev_targp, in xfs_growfs_data_private()
252 XFS_AGB_TO_DADDR(mp, agno, XFS_BNO_BLOCK(mp)), in xfs_growfs_data_private()
253 BTOBB(mp->m_sb.sb_blocksize), 0); in xfs_growfs_data_private()
255 memset(block, 0, mp->m_sb.sb_blocksize); in xfs_growfs_data_private()
261 arec = XFS_ALLOC_REC_ADDR(mp, block, 1); in xfs_growfs_data_private()
262 arec->ar_startblock = cpu_to_be32(XFS_PREALLOC_BLOCKS(mp)); in xfs_growfs_data_private()
265 error = xfs_bwrite(mp, bp); in xfs_growfs_data_private()
272 bp = xfs_buf_get(mp->m_ddev_targp, in xfs_growfs_data_private()
273 XFS_AGB_TO_DADDR(mp, agno, XFS_CNT_BLOCK(mp)), in xfs_growfs_data_private()
274 BTOBB(mp->m_sb.sb_blocksize), 0); in xfs_growfs_data_private()
276 memset(block, 0, mp->m_sb.sb_blocksize); in xfs_growfs_data_private()
282 arec = XFS_ALLOC_REC_ADDR(mp, block, 1); in xfs_growfs_data_private()
283 arec->ar_startblock = cpu_to_be32(XFS_PREALLOC_BLOCKS(mp)); in xfs_growfs_data_private()
287 error = xfs_bwrite(mp, bp); in xfs_growfs_data_private()
294 bp = xfs_buf_get(mp->m_ddev_targp, in xfs_growfs_data_private()
295 XFS_AGB_TO_DADDR(mp, agno, XFS_IBT_BLOCK(mp)), in xfs_growfs_data_private()
296 BTOBB(mp->m_sb.sb_blocksize), 0); in xfs_growfs_data_private()
298 memset(block, 0, mp->m_sb.sb_blocksize); in xfs_growfs_data_private()
304 error = xfs_bwrite(mp, bp); in xfs_growfs_data_private()
317 error = xfs_ialloc_read_agi(mp, tp, agno, &bp); in xfs_growfs_data_private()
325 be32_to_cpu(agi->agi_length) == mp->m_sb.sb_agblocks); in xfs_growfs_data_private()
330 error = xfs_alloc_read_agf(mp, tp, agno, 0, &bp); in xfs_growfs_data_private()
343 error = xfs_free_extent(tp, XFS_AGB_TO_FSB(mp, agno, in xfs_growfs_data_private()
351 if (nb > mp->m_sb.sb_dblocks) in xfs_growfs_data_private()
353 nb - mp->m_sb.sb_dblocks); in xfs_growfs_data_private()
364 mp->m_maxagi = nagimax; in xfs_growfs_data_private()
365 if (mp->m_sb.sb_imax_pct) { in xfs_growfs_data_private()
366 __uint64_t icount = mp->m_sb.sb_dblocks * mp->m_sb.sb_imax_pct; in xfs_growfs_data_private()
368 mp->m_maxicount = icount << mp->m_sb.sb_inopblog; in xfs_growfs_data_private()
370 mp->m_maxicount = 0; in xfs_growfs_data_private()
372 error = xfs_read_buf(mp, mp->m_ddev_targp, in xfs_growfs_data_private()
373 XFS_AGB_TO_DADDR(mp, agno, XFS_SB_BLOCK(mp)), in xfs_growfs_data_private()
374 XFS_FSS_TO_BB(mp, 1), 0, &bp); in xfs_growfs_data_private()
376 xfs_fs_cmn_err(CE_WARN, mp, in xfs_growfs_data_private()
381 xfs_sb_to_disk(XFS_BUF_TO_SBP(bp), &mp->m_sb, XFS_SB_ALL_BITS); in xfs_growfs_data_private()
387 if (!(error = xfs_bwrite(mp, bp))) { in xfs_growfs_data_private()
390 xfs_fs_cmn_err(CE_WARN, mp, in xfs_growfs_data_private()
405 xfs_mount_t *mp, /* mount point for filesystem */ in xfs_growfs_log_private() argument
411 if (nb < XFS_MIN_LOG_BLOCKS || nb < XFS_B_TO_FSB(mp, XFS_MIN_LOG_BYTES)) in xfs_growfs_log_private()
413 if (nb == mp->m_sb.sb_logblocks && in xfs_growfs_log_private()
414 in->isint == (mp->m_sb.sb_logstart != 0)) in xfs_growfs_log_private()
434 xfs_mount_t *mp, in xfs_growfs_data() argument
441 if (!mutex_trylock(&mp->m_growlock)) in xfs_growfs_data()
443 error = xfs_growfs_data_private(mp, in); in xfs_growfs_data()
444 mutex_unlock(&mp->m_growlock); in xfs_growfs_data()
450 xfs_mount_t *mp, in xfs_growfs_log() argument
457 if (!mutex_trylock(&mp->m_growlock)) in xfs_growfs_log()
459 error = xfs_growfs_log_private(mp, in); in xfs_growfs_log()
460 mutex_unlock(&mp->m_growlock); in xfs_growfs_log()
470 xfs_mount_t *mp, in xfs_fs_counts() argument
473 xfs_icsb_sync_counters(mp, XFS_ICSB_LAZY_COUNT); in xfs_fs_counts()
474 spin_lock(&mp->m_sb_lock); in xfs_fs_counts()
475 cnt->freedata = mp->m_sb.sb_fdblocks - XFS_ALLOC_SET_ASIDE(mp); in xfs_fs_counts()
476 cnt->freertx = mp->m_sb.sb_frextents; in xfs_fs_counts()
477 cnt->freeino = mp->m_sb.sb_ifree; in xfs_fs_counts()
478 cnt->allocino = mp->m_sb.sb_icount; in xfs_fs_counts()
479 spin_unlock(&mp->m_sb_lock); in xfs_fs_counts()
500 xfs_mount_t *mp, in xfs_reserve_blocks() argument
511 outval->resblks = mp->m_resblks; in xfs_reserve_blocks()
512 outval->resblks_avail = mp->m_resblks_avail; in xfs_reserve_blocks()
534 spin_lock(&mp->m_sb_lock); in xfs_reserve_blocks()
535 xfs_icsb_sync_counters_locked(mp, 0); in xfs_reserve_blocks()
542 if (mp->m_resblks > request) { in xfs_reserve_blocks()
543 lcounter = mp->m_resblks_avail - request; in xfs_reserve_blocks()
546 mp->m_resblks_avail -= lcounter; in xfs_reserve_blocks()
548 mp->m_resblks = request; in xfs_reserve_blocks()
552 free = mp->m_sb.sb_fdblocks - XFS_ALLOC_SET_ASIDE(mp); in xfs_reserve_blocks()
556 delta = request - mp->m_resblks; in xfs_reserve_blocks()
560 mp->m_resblks += free; in xfs_reserve_blocks()
561 mp->m_resblks_avail += free; in xfs_reserve_blocks()
565 mp->m_resblks = request; in xfs_reserve_blocks()
566 mp->m_resblks_avail += delta; in xfs_reserve_blocks()
571 outval->resblks = mp->m_resblks; in xfs_reserve_blocks()
572 outval->resblks_avail = mp->m_resblks_avail; in xfs_reserve_blocks()
574 spin_unlock(&mp->m_sb_lock); in xfs_reserve_blocks()
591 error = xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, fdblks_delta, 0); in xfs_reserve_blocks()
600 xfs_mount_t *mp) in xfs_fs_log_dummy() argument
606 tp = _xfs_trans_alloc(mp, XFS_TRANS_DUMMY1); in xfs_fs_log_dummy()
607 error = xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES(mp), 0, 0, 0); in xfs_fs_log_dummy()
613 ip = mp->m_rootip; in xfs_fs_log_dummy()
628 xfs_mount_t *mp, in xfs_fs_goingdown() argument
633 struct super_block *sb = freeze_bdev(mp->m_super->s_bdev); in xfs_fs_goingdown()
636 xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT); in xfs_fs_goingdown()
643 xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT); in xfs_fs_goingdown()
646 xfs_force_shutdown(mp, in xfs_fs_goingdown()