Lines Matching refs:mp
218 struct xfs_mount *mp) in xfs_start_flags() argument
228 mp->m_dalign = ap->sunit; in xfs_start_flags()
229 mp->m_swidth = ap->swidth; in xfs_start_flags()
243 mp->m_logbufs = ap->logbufs; in xfs_start_flags()
255 mp->m_logbsize = ap->logbufsize; in xfs_start_flags()
256 mp->m_fsname_len = strlen(ap->fsname) + 1; in xfs_start_flags()
257 mp->m_fsname = kmem_alloc(mp->m_fsname_len, KM_SLEEP); in xfs_start_flags()
258 strcpy(mp->m_fsname, ap->fsname); in xfs_start_flags()
266 mp->m_flags |= XFS_MOUNT_WSYNC; in xfs_start_flags()
269 mp->m_flags |= XFS_MOUNT_INO64; in xfs_start_flags()
270 mp->m_inoadd = XFS_INO64_OFFSET; in xfs_start_flags()
274 mp->m_flags |= XFS_MOUNT_NOATIME; in xfs_start_flags()
277 mp->m_flags |= XFS_MOUNT_RETERR; in xfs_start_flags()
280 mp->m_flags |= XFS_MOUNT_NOALIGN; in xfs_start_flags()
283 mp->m_flags |= XFS_MOUNT_SWALLOC; in xfs_start_flags()
286 mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC; in xfs_start_flags()
289 mp->m_flags |= (XFS_MOUNT_32BITINODES | XFS_MOUNT_32BITINOOPT); in xfs_start_flags()
301 mp->m_flags |= XFS_MOUNT_DFLT_IOSIZE; in xfs_start_flags()
302 mp->m_readio_log = mp->m_writeio_log = ap->iosizelog; in xfs_start_flags()
305 mp->m_flags |= XFS_MOUNT_IDELETE; in xfs_start_flags()
316 mp->m_flags |= XFS_MOUNT_NORECOVERY; in xfs_start_flags()
320 mp->m_flags |= XFS_MOUNT_NOUUID; in xfs_start_flags()
322 mp->m_flags |= XFS_MOUNT_NOLOGFLUSH; in xfs_start_flags()
335 struct xfs_mount *mp) in xfs_finish_flags() argument
340 if (XFS_SB_VERSION_HASLOGV2(&mp->m_sb)) { in xfs_finish_flags()
342 (mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE)) { in xfs_finish_flags()
343 mp->m_logbsize = mp->m_sb.sb_logsunit; in xfs_finish_flags()
344 } else if (ap->logbufsize < mp->m_sb.sb_logsunit) { in xfs_finish_flags()
361 if ((mp->m_sb.sb_flags & XFS_SBF_READONLY) && !ronly) { in xfs_finish_flags()
370 if (XFS_SB_VERSION_HASQUOTA(&mp->m_sb) && in xfs_finish_flags()
371 (mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT)) { in xfs_finish_flags()
381 if (!XFS_SB_VERSION_HASSHARED(&mp->m_sb)) in xfs_finish_flags()
390 if (!ronly || !(mp->m_sb.sb_flags & XFS_SBF_READONLY) || in xfs_finish_flags()
391 (mp->m_sb.sb_shared_vn != 0)) in xfs_finish_flags()
394 mp->m_flags |= XFS_MOUNT_SHARED; in xfs_finish_flags()
399 if (mp->m_sb.sb_shared_vn == 0 && (ap->flags & XFSMNT_DMAPI)) in xfs_finish_flags()
426 struct xfs_mount *mp = XFS_BHVTOM(bhvp); in xfs_mount() local
437 mp->m_dm_ops = p ? *(xfs_dmops_t *) vfs_bhv_custom(p) : xfs_dmcore_stub; in xfs_mount()
439 mp->m_qm_ops = p ? *(xfs_qmops_t *) vfs_bhv_custom(p) : xfs_qmcore_stub; in xfs_mount()
441 mp->m_io_ops = p ? *(xfs_ioops_t *) vfs_bhv_custom(p) : xfs_iocore_xfs; in xfs_mount()
447 error = xfs_blkdev_get(mp, args->logname, &logdev); in xfs_mount()
452 error = xfs_blkdev_get(mp, args->rtname, &rtdev); in xfs_mount()
471 mp->m_ddev_targp = xfs_alloc_buftarg(ddev); in xfs_mount()
472 if (!mp->m_ddev_targp) { in xfs_mount()
478 mp->m_rtdev_targp = xfs_alloc_buftarg(rtdev); in xfs_mount()
479 if (!mp->m_rtdev_targp) in xfs_mount()
482 mp->m_logdev_targp = (logdev && logdev != ddev) ? in xfs_mount()
483 xfs_alloc_buftarg(logdev) : mp->m_ddev_targp; in xfs_mount()
484 if (!mp->m_logdev_targp) in xfs_mount()
490 error = xfs_start_flags(vfsp, args, mp); in xfs_mount()
493 error = xfs_readsb(mp); in xfs_mount()
496 error = xfs_finish_flags(vfsp, args, mp); in xfs_mount()
503 error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_blocksize, in xfs_mount()
504 mp->m_sb.sb_sectsize); in xfs_mount()
508 if (XFS_SB_VERSION_HASSECTOR(&mp->m_sb)) in xfs_mount()
509 log_sector_size = mp->m_sb.sb_logsectsize; in xfs_mount()
510 error = xfs_setsize_buftarg(mp->m_logdev_targp, in xfs_mount()
511 mp->m_sb.sb_blocksize, in xfs_mount()
515 error = xfs_setsize_buftarg(mp->m_rtdev_targp, in xfs_mount()
516 mp->m_sb.sb_blocksize, in xfs_mount()
517 mp->m_sb.sb_sectsize); in xfs_mount()
525 if (mp->m_sb_bp) in xfs_mount()
526 xfs_freesb(mp); in xfs_mount()
528 xfs_binval(mp->m_ddev_targp); in xfs_mount()
530 xfs_binval(mp->m_logdev_targp); in xfs_mount()
532 xfs_binval(mp->m_rtdev_targp); in xfs_mount()
534 xfs_unmountfs_close(mp, credp); in xfs_mount()
545 xfs_mount_t *mp = XFS_BHVTOM(bdp); in xfs_unmount() local
553 rip = mp->m_rootip; in xfs_unmount()
557 error = XFS_SEND_PREUNMOUNT(mp, vfsp, in xfs_unmount()
560 (mp->m_dmevmask & (1<<DM_EVENT_PREUNMOUNT))? in xfs_unmount()
565 unmount_event_flags = (mp->m_dmevmask & (1<<DM_EVENT_UNMOUNT))? in xfs_unmount()
573 xfs_refcache_purge_mp(mp); in xfs_unmount()
575 XFS_bflush(mp->m_ddev_targp); in xfs_unmount()
576 error = xfs_unmount_flush(mp, 0); in xfs_unmount()
592 if (XFS_FORCED_SHUTDOWN(mp)) { in xfs_unmount()
593 error = xfs_sync(&mp->m_bhv, in xfs_unmount()
608 XFS_SEND_UNMOUNT(mp, vfsp, error == 0 ? rvp : NULL, in xfs_unmount()
616 xfs_unmountfs(mp, credp); in xfs_unmount()
631 xfs_mount_t *mp = XFS_BHVTOM(bdp); in xfs_mntupdate() local
636 mp->m_flags |= XFS_MOUNT_NOATIME; in xfs_mntupdate()
638 mp->m_flags &= ~XFS_MOUNT_NOATIME; in xfs_mntupdate()
645 xfs_refcache_purge_mp(mp); in xfs_mntupdate()
646 xfs_flush_buftarg(mp->m_ddev_targp, 0); in xfs_mntupdate()
647 xfs_finish_reclaim_all(mp, 0); in xfs_mntupdate()
658 pincount = xfs_flush_buftarg(mp->m_ddev_targp, 1); in xfs_mntupdate()
666 xfs_log_unmount_write(mp); in xfs_mntupdate()
667 xfs_unmountfs_writesb(mp); in xfs_mntupdate()
683 xfs_mount_t *mp, /* Mount structure we are getting in xfs_unmount_flush() argument
687 xfs_inode_t *rip = mp->m_rootip; in xfs_unmount_flush()
699 if ((rbmip = mp->m_rbmip) != NULL) { in xfs_unmount_flush()
710 rsumip = mp->m_rsumip; in xfs_unmount_flush()
738 error = XFS_QM_UNMOUNT(mp); in xfs_unmount_flush()
794 xfs_mount_t *mp; in xfs_statvfs() local
798 mp = XFS_BHVTOM(bdp); in xfs_statvfs()
799 sbp = &(mp->m_sb); in xfs_statvfs()
803 s = XFS_SB_LOCK(mp); in xfs_statvfs()
810 fakeinos += mp->m_inoadd; in xfs_statvfs()
814 if (mp->m_maxicount) in xfs_statvfs()
816 if (!mp->m_inoadd) in xfs_statvfs()
820 mp->m_maxicount); in xfs_statvfs()
822 XFS_SB_UNLOCK(mp, s); in xfs_statvfs()
824 statp->f_fsid.val[0] = mp->m_dev; in xfs_statvfs()
877 xfs_mount_t *mp; in xfs_sync() local
879 mp = XFS_BHVTOM(bdp); in xfs_sync()
880 return (xfs_syncsub(mp, flags, 0, NULL)); in xfs_sync()
895 xfs_mount_t *mp, in xfs_sync_inodes() argument
930 #define IPOINTER_INSERT(ip, mp) { \ in xfs_sync_inodes() argument
937 XFS_MOUNT_IUNLOCK(mp); \ in xfs_sync_inodes()
947 #define IPOINTER_REMOVE(ip, mp) { \ in xfs_sync_inodes() argument
953 if (mp->m_inodes == (xfs_inode_t *)ipointer) { \ in xfs_sync_inodes()
954 mp->m_inodes = ip; \ in xfs_sync_inodes()
957 ASSERT(mp->m_inodes == (xfs_inode_t *)ipointer); \ in xfs_sync_inodes()
958 mp->m_inodes = NULL; \ in xfs_sync_inodes()
968 if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY) in xfs_sync_inodes()
992 XFS_MOUNT_ILOCK(mp); in xfs_sync_inodes()
994 ip = mp->m_inodes; in xfs_sync_inodes()
1041 IPOINTER_INSERT(ip, mp); in xfs_sync_inodes()
1046 XFS_MOUNT_ILOCK(mp); in xfs_sync_inodes()
1048 IPOINTER_REMOVE(ip, mp); in xfs_sync_inodes()
1061 if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) { in xfs_sync_inodes()
1062 XFS_MOUNT_IUNLOCK(mp); in xfs_sync_inodes()
1121 IPOINTER_INSERT(ip, mp); in xfs_sync_inodes()
1131 XFS_MOUNT_ILOCK(mp); in xfs_sync_inodes()
1136 IPOINTER_REMOVE(ip, mp); in xfs_sync_inodes()
1144 ASSERT(ip->i_mount == mp); in xfs_sync_inodes()
1169 if (XFS_FORCED_SHUTDOWN(mp)) { in xfs_sync_inodes()
1184 IPOINTER_INSERT(ip, mp); in xfs_sync_inodes()
1209 IPOINTER_INSERT(ip, mp); in xfs_sync_inodes()
1236 error = xfs_itobp(mp, NULL, ip, in xfs_sync_inodes()
1244 XFS_MOUNT_ILOCK(mp); in xfs_sync_inodes()
1246 IPOINTER_REMOVE(ip, mp); in xfs_sync_inodes()
1248 XFS_MOUNT_IUNLOCK(mp); in xfs_sync_inodes()
1270 XFS_MOUNT_ILOCK(mp); in xfs_sync_inodes()
1274 IPOINTER_REMOVE(ip, mp); in xfs_sync_inodes()
1282 ASSERT(ip->i_mount == mp); in xfs_sync_inodes()
1286 ASSERT(ip->i_mount == mp); in xfs_sync_inodes()
1298 IPOINTER_REMOVE(ip_next, mp); in xfs_sync_inodes()
1301 ASSERT(ip->i_mount == mp); in xfs_sync_inodes()
1313 XFS_MOUNT_IUNLOCK(mp); in xfs_sync_inodes()
1318 ASSERT(ip->i_mount == mp); in xfs_sync_inodes()
1319 IPOINTER_REMOVE(ip_next, mp); in xfs_sync_inodes()
1331 IPOINTER_INSERT(ip, mp); in xfs_sync_inodes()
1376 IPOINTER_INSERT(ip, mp); in xfs_sync_inodes()
1393 XFS_MOUNT_ILOCK(mp); in xfs_sync_inodes()
1394 IPOINTER_REMOVE(ip, mp); in xfs_sync_inodes()
1396 XFS_MOUNT_IUNLOCK(mp); in xfs_sync_inodes()
1408 IPOINTER_INSERT(ip, mp); in xfs_sync_inodes()
1413 XFS_MOUNT_ILOCK(mp); in xfs_sync_inodes()
1415 IPOINTER_REMOVE(ip, mp); in xfs_sync_inodes()
1422 } while (ip != mp->m_inodes); in xfs_sync_inodes()
1424 XFS_MOUNT_IUNLOCK(mp); in xfs_sync_inodes()
1444 xfs_mount_t *mp, in xfs_syncsub() argument
1462 xfs_log_force(mp, (xfs_lsn_t)0, log_flags); in xfs_syncsub()
1466 xfs_finish_reclaim_all(mp, 1); in xfs_syncsub()
1468 error = xfs_sync_inodes(mp, flags, xflags, bypassed); in xfs_syncsub()
1477 xfs_log_force(mp, (xfs_lsn_t)0, log_flags); in xfs_syncsub()
1486 bp = xfs_getsb(mp, XFS_BUF_TRYLOCK); in xfs_syncsub()
1493 error = xfs_bwrite(mp, bp); in xfs_syncsub()
1502 bp = xfs_getsb(mp, 0); in xfs_syncsub()
1513 xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE); in xfs_syncsub()
1518 error = xfs_bwrite(mp, bp); in xfs_syncsub()
1532 xfs_refcache_purge_mp(mp); in xfs_syncsub()
1534 xfs_refcache_purge_some(mp); in xfs_syncsub()
1541 if (!(flags & SYNC_REMOUNT) && xfs_log_need_covered(mp)) { in xfs_syncsub()
1549 tp = xfs_trans_alloc(mp, XFS_TRANS_DUMMY1); in xfs_syncsub()
1551 XFS_ICHANGE_LOG_RES(mp), in xfs_syncsub()
1557 ip = mp->m_rootip; in xfs_syncsub()
1565 xfs_log_force(mp, (xfs_lsn_t)0, log_flags); in xfs_syncsub()
1573 XFS_bflush(mp->m_ddev_targp); in xfs_syncsub()
1574 if (mp->m_rtdev_targp) { in xfs_syncsub()
1575 XFS_bflush(mp->m_rtdev_targp); in xfs_syncsub()
1591 xfs_mount_t *mp = XFS_BHVTOM(bdp); in xfs_vget() local
1614 error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, 0); in xfs_vget()
1858 struct xfs_mount *mp = XFS_BHVTOM(bhv); in xfs_showargs() local
1861 if (mp->m_flags & xfs_infop->flag) in xfs_showargs()
1865 if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) in xfs_showargs()
1866 seq_printf(m, "," MNTOPT_BIOSIZE "=%d", mp->m_writeio_log); in xfs_showargs()
1868 if (mp->m_logbufs > 0) in xfs_showargs()
1869 seq_printf(m, "," MNTOPT_LOGBUFS "=%d", mp->m_logbufs); in xfs_showargs()
1871 if (mp->m_logbsize > 0) in xfs_showargs()
1872 seq_printf(m, "," MNTOPT_LOGBSIZE "=%d", mp->m_logbsize); in xfs_showargs()
1874 if (mp->m_ddev_targp != mp->m_logdev_targp) in xfs_showargs()
1876 XFS_BUFTARG_NAME(mp->m_logdev_targp)); in xfs_showargs()
1878 if (mp->m_rtdev_targp && mp->m_ddev_targp != mp->m_rtdev_targp) in xfs_showargs()
1880 XFS_BUFTARG_NAME(mp->m_rtdev_targp)); in xfs_showargs()
1882 if (mp->m_dalign > 0) in xfs_showargs()
1884 (int)XFS_FSB_TO_BB(mp, mp->m_dalign)); in xfs_showargs()
1886 if (mp->m_swidth > 0) in xfs_showargs()
1888 (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); in xfs_showargs()
1890 if (!(mp->m_flags & XFS_MOUNT_32BITINOOPT)) in xfs_showargs()
1900 xfs_mount_t *mp = XFS_BHVTOM(bdp); in xfs_freeze() local
1902 while (atomic_read(&mp->m_active_trans) > 0) in xfs_freeze()
1906 xfs_log_unmount_write(mp); in xfs_freeze()
1907 xfs_unmountfs_writesb(mp); in xfs_freeze()