Lines Matching refs:mp
71 xfs_mount_t *mp, in xfs_fs_geometry() argument
75 geo->blocksize = mp->m_sb.sb_blocksize; in xfs_fs_geometry()
76 geo->rtextsize = mp->m_sb.sb_rextsize; in xfs_fs_geometry()
77 geo->agblocks = mp->m_sb.sb_agblocks; in xfs_fs_geometry()
78 geo->agcount = mp->m_sb.sb_agcount; in xfs_fs_geometry()
79 geo->logblocks = mp->m_sb.sb_logblocks; in xfs_fs_geometry()
80 geo->sectsize = mp->m_sb.sb_sectsize; in xfs_fs_geometry()
81 geo->inodesize = mp->m_sb.sb_inodesize; in xfs_fs_geometry()
82 geo->imaxpct = mp->m_sb.sb_imax_pct; in xfs_fs_geometry()
83 geo->datablocks = mp->m_sb.sb_dblocks; in xfs_fs_geometry()
84 geo->rtblocks = mp->m_sb.sb_rblocks; in xfs_fs_geometry()
85 geo->rtextents = mp->m_sb.sb_rextents; in xfs_fs_geometry()
86 geo->logstart = mp->m_sb.sb_logstart; in xfs_fs_geometry()
87 ASSERT(sizeof(geo->uuid)==sizeof(mp->m_sb.sb_uuid)); in xfs_fs_geometry()
88 memcpy(geo->uuid, &mp->m_sb.sb_uuid, sizeof(mp->m_sb.sb_uuid)); in xfs_fs_geometry()
90 geo->sunit = mp->m_sb.sb_unit; in xfs_fs_geometry()
91 geo->swidth = mp->m_sb.sb_width; in xfs_fs_geometry()
96 (XFS_SB_VERSION_HASATTR(&mp->m_sb) ? in xfs_fs_geometry()
98 (XFS_SB_VERSION_HASNLINK(&mp->m_sb) ? in xfs_fs_geometry()
100 (XFS_SB_VERSION_HASQUOTA(&mp->m_sb) ? in xfs_fs_geometry()
102 (XFS_SB_VERSION_HASALIGN(&mp->m_sb) ? in xfs_fs_geometry()
104 (XFS_SB_VERSION_HASDALIGN(&mp->m_sb) ? in xfs_fs_geometry()
106 (XFS_SB_VERSION_HASSHARED(&mp->m_sb) ? in xfs_fs_geometry()
108 (XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb) ? in xfs_fs_geometry()
110 (XFS_SB_VERSION_HASDIRV2(&mp->m_sb) ? in xfs_fs_geometry()
112 (XFS_SB_VERSION_HASSECTOR(&mp->m_sb) ? in xfs_fs_geometry()
114 geo->logsectsize = XFS_SB_VERSION_HASSECTOR(&mp->m_sb) ? in xfs_fs_geometry()
115 mp->m_sb.sb_logsectsize : BBSIZE; in xfs_fs_geometry()
116 geo->rtsectsize = mp->m_sb.sb_blocksize; in xfs_fs_geometry()
117 geo->dirblocksize = mp->m_dirblksize; in xfs_fs_geometry()
121 (XFS_SB_VERSION_HASLOGV2(&mp->m_sb) ? in xfs_fs_geometry()
123 geo->logsunit = mp->m_sb.sb_logsunit; in xfs_fs_geometry()
130 xfs_mount_t *mp, /* mount point for filesystem */ in xfs_growfs_data_private() argument
156 if (nb < mp->m_sb.sb_dblocks || pct < 0 || pct > 100) in xfs_growfs_data_private()
158 dpct = pct - mp->m_sb.sb_imax_pct; in xfs_growfs_data_private()
159 error = xfs_read_buf(mp, mp->m_ddev_targp, in xfs_growfs_data_private()
160 XFS_FSB_TO_BB(mp, nb) - XFS_FSS_TO_BB(mp, 1), in xfs_growfs_data_private()
161 XFS_FSS_TO_BB(mp, 1), 0, &bp); in xfs_growfs_data_private()
168 nb_mod = do_div(new, mp->m_sb.sb_agblocks); in xfs_growfs_data_private()
172 nb = nagcount * mp->m_sb.sb_agblocks; in xfs_growfs_data_private()
173 if (nb < mp->m_sb.sb_dblocks) in xfs_growfs_data_private()
176 new = nb - mp->m_sb.sb_dblocks; in xfs_growfs_data_private()
177 oagcount = mp->m_sb.sb_agcount; in xfs_growfs_data_private()
179 down_write(&mp->m_peraglock); in xfs_growfs_data_private()
180 mp->m_perag = kmem_realloc(mp->m_perag, in xfs_growfs_data_private()
184 memset(&mp->m_perag[oagcount], 0, in xfs_growfs_data_private()
186 mp->m_flags |= XFS_MOUNT_32BITINODES; in xfs_growfs_data_private()
187 nagimax = xfs_initialize_perag(mp, nagcount); in xfs_growfs_data_private()
188 up_write(&mp->m_peraglock); in xfs_growfs_data_private()
190 tp = xfs_trans_alloc(mp, XFS_TRANS_GROWFS); in xfs_growfs_data_private()
191 if ((error = xfs_trans_reserve(tp, XFS_GROWFS_SPACE_RES(mp), in xfs_growfs_data_private()
192 XFS_GROWDATA_LOG_RES(mp), 0, 0, 0))) { in xfs_growfs_data_private()
202 bp = xfs_buf_get(mp->m_ddev_targp, in xfs_growfs_data_private()
203 XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), in xfs_growfs_data_private()
204 XFS_FSS_TO_BB(mp, 1), 0); in xfs_growfs_data_private()
206 memset(agf, 0, mp->m_sb.sb_sectsize); in xfs_growfs_data_private()
213 (agno * (xfs_rfsblock_t)mp->m_sb.sb_agblocks); in xfs_growfs_data_private()
215 agsize = mp->m_sb.sb_agblocks; in xfs_growfs_data_private()
218 XFS_BNO_BLOCK(mp)); in xfs_growfs_data_private()
220 XFS_CNT_BLOCK(mp)); in xfs_growfs_data_private()
224 INT_SET(agf->agf_fllast, ARCH_CONVERT, XFS_AGFL_SIZE(mp) - 1); in xfs_growfs_data_private()
226 tmpsize = agsize - XFS_PREALLOC_BLOCKS(mp); in xfs_growfs_data_private()
229 error = xfs_bwrite(mp, bp); in xfs_growfs_data_private()
236 bp = xfs_buf_get(mp->m_ddev_targp, in xfs_growfs_data_private()
237 XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), in xfs_growfs_data_private()
238 XFS_FSS_TO_BB(mp, 1), 0); in xfs_growfs_data_private()
240 memset(agi, 0, mp->m_sb.sb_sectsize); in xfs_growfs_data_private()
246 INT_SET(agi->agi_root, ARCH_CONVERT, XFS_IBT_BLOCK(mp)); in xfs_growfs_data_private()
254 error = xfs_bwrite(mp, bp); in xfs_growfs_data_private()
261 bp = xfs_buf_get(mp->m_ddev_targp, in xfs_growfs_data_private()
262 XFS_AGB_TO_DADDR(mp, agno, XFS_BNO_BLOCK(mp)), in xfs_growfs_data_private()
263 BTOBB(mp->m_sb.sb_blocksize), 0); in xfs_growfs_data_private()
265 memset(block, 0, mp->m_sb.sb_blocksize); in xfs_growfs_data_private()
271 arec = XFS_BTREE_REC_ADDR(mp->m_sb.sb_blocksize, xfs_alloc, in xfs_growfs_data_private()
272 block, 1, mp->m_alloc_mxr[0]); in xfs_growfs_data_private()
274 XFS_PREALLOC_BLOCKS(mp)); in xfs_growfs_data_private()
277 error = xfs_bwrite(mp, bp); in xfs_growfs_data_private()
284 bp = xfs_buf_get(mp->m_ddev_targp, in xfs_growfs_data_private()
285 XFS_AGB_TO_DADDR(mp, agno, XFS_CNT_BLOCK(mp)), in xfs_growfs_data_private()
286 BTOBB(mp->m_sb.sb_blocksize), 0); in xfs_growfs_data_private()
288 memset(block, 0, mp->m_sb.sb_blocksize); in xfs_growfs_data_private()
294 arec = XFS_BTREE_REC_ADDR(mp->m_sb.sb_blocksize, xfs_alloc, in xfs_growfs_data_private()
295 block, 1, mp->m_alloc_mxr[0]); in xfs_growfs_data_private()
297 XFS_PREALLOC_BLOCKS(mp)); in xfs_growfs_data_private()
301 error = xfs_bwrite(mp, bp); in xfs_growfs_data_private()
308 bp = xfs_buf_get(mp->m_ddev_targp, in xfs_growfs_data_private()
309 XFS_AGB_TO_DADDR(mp, agno, XFS_IBT_BLOCK(mp)), in xfs_growfs_data_private()
310 BTOBB(mp->m_sb.sb_blocksize), 0); in xfs_growfs_data_private()
312 memset(block, 0, mp->m_sb.sb_blocksize); in xfs_growfs_data_private()
318 error = xfs_bwrite(mp, bp); in xfs_growfs_data_private()
331 error = xfs_ialloc_read_agi(mp, tp, agno, &bp); in xfs_growfs_data_private()
340 mp->m_sb.sb_agblocks); in xfs_growfs_data_private()
345 error = xfs_alloc_read_agf(mp, tp, agno, 0, &bp); in xfs_growfs_data_private()
357 error = xfs_free_extent(tp, XFS_AGB_TO_FSB(mp, agno, in xfs_growfs_data_private()
365 if (nb > mp->m_sb.sb_dblocks) in xfs_growfs_data_private()
367 nb - mp->m_sb.sb_dblocks); in xfs_growfs_data_private()
378 mp->m_maxagi = nagimax; in xfs_growfs_data_private()
379 if (mp->m_sb.sb_imax_pct) { in xfs_growfs_data_private()
380 __uint64_t icount = mp->m_sb.sb_dblocks * mp->m_sb.sb_imax_pct; in xfs_growfs_data_private()
382 mp->m_maxicount = icount << mp->m_sb.sb_inopblog; in xfs_growfs_data_private()
384 mp->m_maxicount = 0; in xfs_growfs_data_private()
386 error = xfs_read_buf(mp, mp->m_ddev_targp, in xfs_growfs_data_private()
387 XFS_AGB_TO_DADDR(mp, agno, XFS_SB_BLOCK(mp)), in xfs_growfs_data_private()
388 XFS_FSS_TO_BB(mp, 1), 0, &bp); in xfs_growfs_data_private()
390 xfs_fs_cmn_err(CE_WARN, mp, in xfs_growfs_data_private()
396 xfs_xlatesb(sbp, &mp->m_sb, -1, ARCH_CONVERT, XFS_SB_ALL_BITS); in xfs_growfs_data_private()
402 if (!(error = xfs_bwrite(mp, bp))) { in xfs_growfs_data_private()
405 xfs_fs_cmn_err(CE_WARN, mp, in xfs_growfs_data_private()
420 xfs_mount_t *mp, /* mount point for filesystem */ in xfs_growfs_log_private() argument
426 if (nb < XFS_MIN_LOG_BLOCKS || nb < XFS_B_TO_FSB(mp, XFS_MIN_LOG_BYTES)) in xfs_growfs_log_private()
428 if (nb == mp->m_sb.sb_logblocks && in xfs_growfs_log_private()
429 in->isint == (mp->m_sb.sb_logstart != 0)) in xfs_growfs_log_private()
449 xfs_mount_t *mp, in xfs_growfs_data() argument
453 if (!cpsema(&mp->m_growlock)) in xfs_growfs_data()
455 error = xfs_growfs_data_private(mp, in); in xfs_growfs_data()
456 vsema(&mp->m_growlock); in xfs_growfs_data()
462 xfs_mount_t *mp, in xfs_growfs_log() argument
466 if (!cpsema(&mp->m_growlock)) in xfs_growfs_log()
468 error = xfs_growfs_log_private(mp, in); in xfs_growfs_log()
469 vsema(&mp->m_growlock); in xfs_growfs_log()
479 xfs_mount_t *mp, in xfs_fs_counts() argument
484 s = XFS_SB_LOCK(mp); in xfs_fs_counts()
485 cnt->freedata = mp->m_sb.sb_fdblocks; in xfs_fs_counts()
486 cnt->freertx = mp->m_sb.sb_frextents; in xfs_fs_counts()
487 cnt->freeino = mp->m_sb.sb_ifree; in xfs_fs_counts()
488 cnt->allocino = mp->m_sb.sb_icount; in xfs_fs_counts()
489 XFS_SB_UNLOCK(mp, s); in xfs_fs_counts()
510 xfs_mount_t *mp, in xfs_reserve_blocks() argument
521 outval->resblks = mp->m_resblks; in xfs_reserve_blocks()
522 outval->resblks_avail = mp->m_resblks_avail; in xfs_reserve_blocks()
527 s = XFS_SB_LOCK(mp); in xfs_reserve_blocks()
534 if (mp->m_resblks > request) { in xfs_reserve_blocks()
535 lcounter = mp->m_resblks_avail - request; in xfs_reserve_blocks()
537 mp->m_sb.sb_fdblocks += lcounter; in xfs_reserve_blocks()
538 mp->m_resblks_avail -= lcounter; in xfs_reserve_blocks()
540 mp->m_resblks = request; in xfs_reserve_blocks()
542 delta = request - mp->m_resblks; in xfs_reserve_blocks()
543 lcounter = mp->m_sb.sb_fdblocks - delta; in xfs_reserve_blocks()
546 mp->m_resblks += mp->m_sb.sb_fdblocks; in xfs_reserve_blocks()
547 mp->m_resblks_avail += mp->m_sb.sb_fdblocks; in xfs_reserve_blocks()
548 mp->m_sb.sb_fdblocks = 0; in xfs_reserve_blocks()
550 mp->m_sb.sb_fdblocks = lcounter; in xfs_reserve_blocks()
551 mp->m_resblks = request; in xfs_reserve_blocks()
552 mp->m_resblks_avail += delta; in xfs_reserve_blocks()
556 outval->resblks = mp->m_resblks; in xfs_reserve_blocks()
557 outval->resblks_avail = mp->m_resblks_avail; in xfs_reserve_blocks()
558 XFS_SB_UNLOCK(mp, s); in xfs_reserve_blocks()
563 xfs_fs_log_dummy(xfs_mount_t *mp) in xfs_fs_log_dummy() argument
569 tp = _xfs_trans_alloc(mp, XFS_TRANS_DUMMY1); in xfs_fs_log_dummy()
570 atomic_inc(&mp->m_active_trans); in xfs_fs_log_dummy()
571 if (xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES(mp), 0, 0, 0)) { in xfs_fs_log_dummy()
576 ip = mp->m_rootip; in xfs_fs_log_dummy()
590 xfs_mount_t *mp, in xfs_fs_goingdown() argument
595 struct vfs *vfsp = XFS_MTOVFS(mp); in xfs_fs_goingdown()
599 xfs_force_shutdown(mp, XFS_FORCE_UMOUNT); in xfs_fs_goingdown()
606 xfs_force_shutdown(mp, XFS_FORCE_UMOUNT); in xfs_fs_goingdown()
609 xfs_force_shutdown(mp, XFS_FORCE_UMOUNT|XFS_LOG_IO_ERROR); in xfs_fs_goingdown()