Lines Matching refs:mp

75 	xfs_mount_t		*mp;		/* mount point structure */  in xfs_ialloc_log_di()  local
111 mp = tp->t_mountp; in xfs_ialloc_log_di()
119 ioffset = off << mp->m_sb.sb_inodelog; in xfs_ialloc_log_di()
161 args.mp = tp->t_mountp; in xfs_ialloc_ag_alloc()
167 newlen = XFS_IALLOC_INODES(args.mp); in xfs_ialloc_ag_alloc()
168 if (args.mp->m_maxicount && in xfs_ialloc_ag_alloc()
169 args.mp->m_sb.sb_icount + newlen > args.mp->m_maxicount) in xfs_ialloc_ag_alloc()
171 args.minlen = args.maxlen = XFS_IALLOC_BLOCKS(args.mp); in xfs_ialloc_ag_alloc()
181 if (args.mp->m_sinoalign) { in xfs_ialloc_ag_alloc()
182 ASSERT(!(args.mp->m_flags & XFS_MOUNT_NOALIGN)); in xfs_ialloc_ag_alloc()
183 args.alignment = args.mp->m_dalign; in xfs_ialloc_ag_alloc()
185 } else if (XFS_SB_VERSION_HASALIGN(&args.mp->m_sb) && in xfs_ialloc_ag_alloc()
186 args.mp->m_sb.sb_inoalignmt >= in xfs_ialloc_ag_alloc()
187 XFS_B_TO_FSBT(args.mp, XFS_INODE_CLUSTER_SIZE(args.mp))) in xfs_ialloc_ag_alloc()
188 args.alignment = args.mp->m_sb.sb_inoalignmt; in xfs_ialloc_ag_alloc()
198 args.fsbno = XFS_AGB_TO_FSB(args.mp, INT_GET(agi->agi_seqno, ARCH_CONVERT), in xfs_ialloc_ag_alloc()
210 args.minleft = XFS_IN_MAXLEVELS(args.mp) - 1; in xfs_ialloc_ag_alloc()
221 args.fsbno = XFS_AGB_TO_FSB(args.mp, in xfs_ialloc_ag_alloc()
223 if (XFS_SB_VERSION_HASALIGN(&args.mp->m_sb) && in xfs_ialloc_ag_alloc()
224 args.mp->m_sb.sb_inoalignmt >= in xfs_ialloc_ag_alloc()
225 XFS_B_TO_FSBT(args.mp, XFS_INODE_CLUSTER_SIZE(args.mp))) in xfs_ialloc_ag_alloc()
226 args.alignment = args.mp->m_sb.sb_inoalignmt; in xfs_ialloc_ag_alloc()
241 newino = XFS_OFFBNO_TO_AGINO(args.mp, args.agbno, 0); in xfs_ialloc_ag_alloc()
247 if (args.mp->m_sb.sb_blocksize >= XFS_INODE_CLUSTER_SIZE(args.mp)) { in xfs_ialloc_ag_alloc()
250 ninodes = args.mp->m_sb.sb_inopblock; in xfs_ialloc_ag_alloc()
252 blks_per_cluster = XFS_INODE_CLUSTER_SIZE(args.mp) / in xfs_ialloc_ag_alloc()
253 args.mp->m_sb.sb_blocksize; in xfs_ialloc_ag_alloc()
255 ninodes = blks_per_cluster * args.mp->m_sb.sb_inopblock; in xfs_ialloc_ag_alloc()
264 if (XFS_SB_VERSION_HASNLINK(&args.mp->m_sb)) in xfs_ialloc_ag_alloc()
277 d = XFS_AGB_TO_DADDR(args.mp, INT_GET(agi->agi_seqno, ARCH_CONVERT), in xfs_ialloc_ag_alloc()
279 fbuf = xfs_trans_get_buf(tp, args.mp->m_ddev_targp, d, in xfs_ialloc_ag_alloc()
280 args.mp->m_bsize * blks_per_cluster, in xfs_ialloc_ag_alloc()
289 free = XFS_MAKE_IPTR(args.mp, fbuf, i); in xfs_ialloc_ag_alloc()
299 down_read(&args.mp->m_peraglock); in xfs_ialloc_ag_alloc()
300 args.mp->m_perag[INT_GET(agi->agi_seqno, ARCH_CONVERT)].pagi_freecount += newlen; in xfs_ialloc_ag_alloc()
301 up_read(&args.mp->m_peraglock); in xfs_ialloc_ag_alloc()
306 cur = xfs_btree_init_cursor(args.mp, tp, agbp, in xfs_ialloc_ag_alloc()
341 xfs_mount_t *mp) in xfs_ialloc_next_ag() argument
345 spin_lock(&mp->m_agirotor_lock); in xfs_ialloc_next_ag()
346 agno = mp->m_agirotor; in xfs_ialloc_next_ag()
347 if (++mp->m_agirotor == mp->m_maxagi) in xfs_ialloc_next_ag()
348 mp->m_agirotor = 0; in xfs_ialloc_next_ag()
349 spin_unlock(&mp->m_agirotor_lock); in xfs_ialloc_next_ag()
371 xfs_mount_t *mp; /* mount point structure */ in xfs_ialloc_ag_select() local
381 mp = tp->t_mountp; in xfs_ialloc_ag_select()
382 agcount = mp->m_maxagi; in xfs_ialloc_ag_select()
384 pagno = xfs_ialloc_next_ag(mp); in xfs_ialloc_ag_select()
386 pagno = XFS_INO_TO_AGNO(mp, parent); in xfs_ialloc_ag_select()
400 down_read(&mp->m_peraglock); in xfs_ialloc_ag_select()
402 pag = &mp->m_perag[agno]; in xfs_ialloc_ag_select()
404 if (xfs_ialloc_read_agi(mp, tp, agno, &agbp)) { in xfs_ialloc_ag_select()
412 xfs_ialloc_next_ag(mp); in xfs_ialloc_ag_select()
420 ineed = pag->pagi_freecount ? 0 : XFS_IALLOC_BLOCKS(mp); in xfs_ialloc_ag_select()
423 xfs_ialloc_read_agi(mp, tp, agno, &agbp)) { in xfs_ialloc_ag_select()
427 (void)xfs_alloc_pagf_init(mp, tp, agno, flags); in xfs_ialloc_ag_select()
437 xfs_ialloc_read_agi(mp, tp, agno, &agbp)) { in xfs_ialloc_ag_select()
441 up_read(&mp->m_peraglock); in xfs_ialloc_ag_select()
453 if (XFS_FORCED_SHUTDOWN(mp)) { in xfs_ialloc_ag_select()
454 up_read(&mp->m_peraglock); in xfs_ialloc_ag_select()
462 up_read(&mp->m_peraglock); in xfs_ialloc_ag_select()
522 xfs_mount_t *mp; /* file system mount structure */ in xfs_dialloc() local
558 mp = tp->t_mountp; in xfs_dialloc()
559 agcount = mp->m_sb.sb_agcount; in xfs_dialloc()
562 pagno = XFS_INO_TO_AGNO(mp, parent); in xfs_dialloc()
563 pagino = XFS_INO_TO_AGINO(mp, parent); in xfs_dialloc()
571 if (mp->m_maxicount && in xfs_dialloc()
572 mp->m_sb.sb_icount + XFS_IALLOC_INODES(mp) > mp->m_maxicount) { in xfs_dialloc()
629 down_read(&mp->m_peraglock); in xfs_dialloc()
630 if (mp->m_perag[tagno].pagi_inodeok == 0) { in xfs_dialloc()
631 up_read(&mp->m_peraglock); in xfs_dialloc()
634 error = xfs_ialloc_read_agi(mp, tp, tagno, &agbp); in xfs_dialloc()
635 up_read(&mp->m_peraglock); in xfs_dialloc()
648 cur = xfs_btree_init_cursor(mp, tp, agbp, INT_GET(agi->agi_seqno, ARCH_CONVERT), in xfs_dialloc()
674 XFS_FORCED_SHUTDOWN(mp)); in xfs_dialloc()
873 ASSERT((XFS_AGINO_TO_OFFSET(mp, rec.ir_startino) % in xfs_dialloc()
875 ino = XFS_AGINO_TO_INO(mp, agno, rec.ir_startino + offset); in xfs_dialloc()
883 down_read(&mp->m_peraglock); in xfs_dialloc()
884 mp->m_perag[tagno].pagi_freecount--; in xfs_dialloc()
885 up_read(&mp->m_peraglock); in xfs_dialloc()
902 XFS_FORCED_SHUTDOWN(mp)); in xfs_dialloc()
940 xfs_mount_t *mp; /* mount structure for filesystem */ in xfs_difree() local
944 mp = tp->t_mountp; in xfs_difree()
949 agno = XFS_INO_TO_AGNO(mp, inode); in xfs_difree()
950 if (agno >= mp->m_sb.sb_agcount) { in xfs_difree()
953 agno, mp->m_sb.sb_agcount, mp->m_fsname); in xfs_difree()
957 agino = XFS_INO_TO_AGINO(mp, inode); in xfs_difree()
958 if (inode != XFS_AGINO_TO_INO(mp, agno, agino)) { in xfs_difree()
961 inode, XFS_AGINO_TO_INO(mp, agno, agino), mp->m_fsname); in xfs_difree()
965 agbno = XFS_AGINO_TO_AGBNO(mp, agino); in xfs_difree()
966 if (agbno >= mp->m_sb.sb_agblocks) { in xfs_difree()
969 agbno, mp->m_sb.sb_agblocks, mp->m_fsname); in xfs_difree()
976 down_read(&mp->m_peraglock); in xfs_difree()
977 error = xfs_ialloc_read_agi(mp, tp, agno, &agbp); in xfs_difree()
978 up_read(&mp->m_peraglock); in xfs_difree()
982 error, mp->m_fsname); in xfs_difree()
991 cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO, in xfs_difree()
1010 XFS_FORCED_SHUTDOWN(mp)); in xfs_difree()
1019 error, mp->m_fsname); in xfs_difree()
1027 error, mp->m_fsname); in xfs_difree()
1046 if ((mp->m_flags & XFS_MOUNT_IDELETE) && in xfs_difree()
1047 (rec.ir_freecount == XFS_IALLOC_INODES(mp))) { in xfs_difree()
1050 *first_ino = XFS_AGINO_TO_INO(mp, agno, rec.ir_startino); in xfs_difree()
1057 ilen = XFS_IALLOC_INODES(mp); in xfs_difree()
1061 down_read(&mp->m_peraglock); in xfs_difree()
1062 mp->m_perag[agno].pagi_freecount -= ilen - 1; in xfs_difree()
1063 up_read(&mp->m_peraglock); in xfs_difree()
1069 error, mp->m_fsname); in xfs_difree()
1073 xfs_bmap_add_free(XFS_AGB_TO_FSB(mp, in xfs_difree()
1074 agno, XFS_INO_TO_AGBNO(mp,rec.ir_startino)), in xfs_difree()
1075 XFS_IALLOC_BLOCKS(mp), flist, mp); in xfs_difree()
1082 error, mp->m_fsname); in xfs_difree()
1090 down_read(&mp->m_peraglock); in xfs_difree()
1091 mp->m_perag[agno].pagi_freecount++; in xfs_difree()
1092 up_read(&mp->m_peraglock); in xfs_difree()
1116 XFS_FORCED_SHUTDOWN(mp)); in xfs_difree()
1133 xfs_mount_t *mp, /* file system mount structure */ in xfs_dilocate() argument
1161 agno = XFS_INO_TO_AGNO(mp, ino); in xfs_dilocate()
1162 agino = XFS_INO_TO_AGINO(mp, ino); in xfs_dilocate()
1163 agbno = XFS_AGINO_TO_AGBNO(mp, agino); in xfs_dilocate()
1164 if (agno >= mp->m_sb.sb_agcount || agbno >= mp->m_sb.sb_agblocks || in xfs_dilocate()
1165 ino != XFS_AGINO_TO_INO(mp, agno, agino)) { in xfs_dilocate()
1167 if (agno >= mp->m_sb.sb_agcount) { in xfs_dilocate()
1168 xfs_fs_cmn_err(CE_ALERT, mp, in xfs_dilocate()
1171 agno, mp->m_sb.sb_agcount); in xfs_dilocate()
1173 if (agbno >= mp->m_sb.sb_agblocks) { in xfs_dilocate()
1174 xfs_fs_cmn_err(CE_ALERT, mp, in xfs_dilocate()
1178 (unsigned long) mp->m_sb.sb_agblocks); in xfs_dilocate()
1180 if (ino != XFS_AGINO_TO_INO(mp, agno, agino)) { in xfs_dilocate()
1181 xfs_fs_cmn_err(CE_ALERT, mp, in xfs_dilocate()
1185 ino, XFS_AGINO_TO_INO(mp, agno, agino)); in xfs_dilocate()
1190 if ((mp->m_sb.sb_blocksize >= XFS_INODE_CLUSTER_SIZE(mp)) || in xfs_dilocate()
1192 offset = XFS_INO_TO_OFFSET(mp, ino); in xfs_dilocate()
1193 ASSERT(offset < mp->m_sb.sb_inopblock); in xfs_dilocate()
1194 *bno = XFS_AGB_TO_FSB(mp, agno, agbno); in xfs_dilocate()
1199 blks_per_cluster = XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_blocklog; in xfs_dilocate()
1201 offset = XFS_INO_TO_OFFSET(mp, ino); in xfs_dilocate()
1202 ASSERT(offset < mp->m_sb.sb_inopblock); in xfs_dilocate()
1203 cluster_agbno = XFS_FSB_TO_AGBNO(mp, *bno); in xfs_dilocate()
1204 *off = ((agbno - cluster_agbno) * mp->m_sb.sb_inopblock) + in xfs_dilocate()
1209 if (mp->m_inoalign_mask) { in xfs_dilocate()
1210 offset_agbno = agbno & mp->m_inoalign_mask; in xfs_dilocate()
1213 down_read(&mp->m_peraglock); in xfs_dilocate()
1214 error = xfs_ialloc_read_agi(mp, tp, agno, &agbp); in xfs_dilocate()
1215 up_read(&mp->m_peraglock); in xfs_dilocate()
1218 xfs_fs_cmn_err(CE_ALERT, mp, "xfs_dilocate: " in xfs_dilocate()
1225 cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO, in xfs_dilocate()
1229 xfs_fs_cmn_err(CE_ALERT, mp, "xfs_dilocate: " in xfs_dilocate()
1237 xfs_fs_cmn_err(CE_ALERT, mp, "xfs_dilocate: " in xfs_dilocate()
1244 xfs_fs_cmn_err(CE_ALERT, mp, "xfs_dilocate: " in xfs_dilocate()
1253 chunk_agbno = XFS_AGINO_TO_AGBNO(mp, chunk_agino); in xfs_dilocate()
1259 offset = ((agbno - cluster_agbno) * mp->m_sb.sb_inopblock) + in xfs_dilocate()
1260 XFS_INO_TO_OFFSET(mp, ino); in xfs_dilocate()
1261 *bno = XFS_AGB_TO_FSB(mp, agno, cluster_agbno); in xfs_dilocate()
1276 xfs_mount_t *mp) /* file system mount structure */ in xfs_ialloc_compute_maxlevels() argument
1284 maxleafents = (1LL << XFS_INO_AGINO_BITS(mp)) >> in xfs_ialloc_compute_maxlevels()
1286 minleafrecs = mp->m_alloc_mnr[0]; in xfs_ialloc_compute_maxlevels()
1287 minnoderecs = mp->m_alloc_mnr[1]; in xfs_ialloc_compute_maxlevels()
1291 mp->m_in_maxlevels = level; in xfs_ialloc_compute_maxlevels()
1341 xfs_mount_t *mp, /* file system mount structure */ in xfs_ialloc_read_agi() argument
1354 mp, tp, mp->m_ddev_targp, in xfs_ialloc_read_agi()
1355 XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), in xfs_ialloc_read_agi()
1356 XFS_FSS_TO_BB(mp, 1), 0, &bp); in xfs_ialloc_read_agi()
1369 if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IALLOC_READ_AGI, in xfs_ialloc_read_agi()
1372 mp, agi); in xfs_ialloc_read_agi()
1376 pag = &mp->m_perag[agno]; in xfs_ialloc_read_agi()
1387 || XFS_FORCED_SHUTDOWN(mp)); in xfs_ialloc_read_agi()