Lines Matching full:mp
58 struct xfs_mount *mp, in xfs_mount_set_dax_mode() argument
63 mp->m_flags &= ~(XFS_MOUNT_DAX_ALWAYS | XFS_MOUNT_DAX_NEVER); in xfs_mount_set_dax_mode()
66 mp->m_flags |= XFS_MOUNT_DAX_ALWAYS; in xfs_mount_set_dax_mode()
67 mp->m_flags &= ~XFS_MOUNT_DAX_NEVER; in xfs_mount_set_dax_mode()
70 mp->m_flags |= XFS_MOUNT_DAX_NEVER; in xfs_mount_set_dax_mode()
71 mp->m_flags &= ~XFS_MOUNT_DAX_ALWAYS; in xfs_mount_set_dax_mode()
170 struct xfs_mount *mp = XFS_M(root->d_sb); in xfs_fs_show_options() local
174 if (mp->m_flags & xfs_infop->flag) in xfs_fs_show_options()
179 (mp->m_flags & XFS_MOUNT_SMALL_INUMS) ? 32 : 64); in xfs_fs_show_options()
181 if (mp->m_flags & XFS_MOUNT_ALLOCSIZE) in xfs_fs_show_options()
183 (1 << mp->m_allocsize_log) >> 10); in xfs_fs_show_options()
185 if (mp->m_logbufs > 0) in xfs_fs_show_options()
186 seq_printf(m, ",logbufs=%d", mp->m_logbufs); in xfs_fs_show_options()
187 if (mp->m_logbsize > 0) in xfs_fs_show_options()
188 seq_printf(m, ",logbsize=%dk", mp->m_logbsize >> 10); in xfs_fs_show_options()
190 if (mp->m_logname) in xfs_fs_show_options()
191 seq_show_option(m, "logdev", mp->m_logname); in xfs_fs_show_options()
192 if (mp->m_rtname) in xfs_fs_show_options()
193 seq_show_option(m, "rtdev", mp->m_rtname); in xfs_fs_show_options()
195 if (mp->m_dalign > 0) in xfs_fs_show_options()
197 (int)XFS_FSB_TO_BB(mp, mp->m_dalign)); in xfs_fs_show_options()
198 if (mp->m_swidth > 0) in xfs_fs_show_options()
200 (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); in xfs_fs_show_options()
202 if (mp->m_qflags & XFS_UQUOTA_ACCT) { in xfs_fs_show_options()
203 if (mp->m_qflags & XFS_UQUOTA_ENFD) in xfs_fs_show_options()
209 if (mp->m_qflags & XFS_PQUOTA_ACCT) { in xfs_fs_show_options()
210 if (mp->m_qflags & XFS_PQUOTA_ENFD) in xfs_fs_show_options()
215 if (mp->m_qflags & XFS_GQUOTA_ACCT) { in xfs_fs_show_options()
216 if (mp->m_qflags & XFS_GQUOTA_ENFD) in xfs_fs_show_options()
222 if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) in xfs_fs_show_options()
238 * because in the growfs case, mp->m_sb.sb_agcount is not yet updated
245 struct xfs_mount *mp, in xfs_set_inode_alloc() argument
250 xfs_sb_t *sbp = &mp->m_sb; in xfs_set_inode_alloc()
259 if (M_IGEO(mp)->maxicount) { in xfs_set_inode_alloc()
272 agino = XFS_AGB_TO_AGINO(mp, sbp->sb_agblocks - 1); in xfs_set_inode_alloc()
273 ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino); in xfs_set_inode_alloc()
280 if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && ino > XFS_MAXINUMBER_32) in xfs_set_inode_alloc()
281 mp->m_flags |= XFS_MOUNT_32BITINODES; in xfs_set_inode_alloc()
283 mp->m_flags &= ~XFS_MOUNT_32BITINODES; in xfs_set_inode_alloc()
288 ino = XFS_AGINO_TO_INO(mp, index, agino); in xfs_set_inode_alloc()
290 pag = xfs_perag_get(mp, index); in xfs_set_inode_alloc()
292 if (mp->m_flags & XFS_MOUNT_32BITINODES) { in xfs_set_inode_alloc()
312 return (mp->m_flags & XFS_MOUNT_32BITINODES) ? maxagi : agcount; in xfs_set_inode_alloc()
317 xfs_mount_t *mp, in xfs_blkdev_get() argument
324 mp); in xfs_blkdev_get()
327 xfs_warn(mp, "Invalid device [%s], error=%d", name, error); in xfs_blkdev_get()
350 struct xfs_mount *mp) in xfs_close_devices() argument
352 struct dax_device *dax_ddev = mp->m_ddev_targp->bt_daxdev; in xfs_close_devices()
354 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { in xfs_close_devices()
355 struct block_device *logdev = mp->m_logdev_targp->bt_bdev; in xfs_close_devices()
356 struct dax_device *dax_logdev = mp->m_logdev_targp->bt_daxdev; in xfs_close_devices()
358 xfs_free_buftarg(mp->m_logdev_targp); in xfs_close_devices()
362 if (mp->m_rtdev_targp) { in xfs_close_devices()
363 struct block_device *rtdev = mp->m_rtdev_targp->bt_bdev; in xfs_close_devices()
364 struct dax_device *dax_rtdev = mp->m_rtdev_targp->bt_daxdev; in xfs_close_devices()
366 xfs_free_buftarg(mp->m_rtdev_targp); in xfs_close_devices()
370 xfs_free_buftarg(mp->m_ddev_targp); in xfs_close_devices()
386 struct xfs_mount *mp) in xfs_open_devices() argument
388 struct block_device *ddev = mp->m_super->s_bdev; in xfs_open_devices()
397 if (mp->m_logname) { in xfs_open_devices()
398 error = xfs_blkdev_get(mp, mp->m_logname, &logdev); in xfs_open_devices()
404 if (mp->m_rtname) { in xfs_open_devices()
405 error = xfs_blkdev_get(mp, mp->m_rtname, &rtdev); in xfs_open_devices()
410 xfs_warn(mp, in xfs_open_devices()
422 mp->m_ddev_targp = xfs_alloc_buftarg(mp, ddev, dax_ddev); in xfs_open_devices()
423 if (!mp->m_ddev_targp) in xfs_open_devices()
427 mp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev, dax_rtdev); in xfs_open_devices()
428 if (!mp->m_rtdev_targp) in xfs_open_devices()
433 mp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev, dax_logdev); in xfs_open_devices()
434 if (!mp->m_logdev_targp) in xfs_open_devices()
437 mp->m_logdev_targp = mp->m_ddev_targp; in xfs_open_devices()
443 if (mp->m_rtdev_targp) in xfs_open_devices()
444 xfs_free_buftarg(mp->m_rtdev_targp); in xfs_open_devices()
446 xfs_free_buftarg(mp->m_ddev_targp); in xfs_open_devices()
465 struct xfs_mount *mp) in xfs_setup_devices() argument
469 error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_sectsize); in xfs_setup_devices()
473 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { in xfs_setup_devices()
476 if (xfs_sb_version_hassector(&mp->m_sb)) in xfs_setup_devices()
477 log_sector_size = mp->m_sb.sb_logsectsize; in xfs_setup_devices()
478 error = xfs_setsize_buftarg(mp->m_logdev_targp, in xfs_setup_devices()
483 if (mp->m_rtdev_targp) { in xfs_setup_devices()
484 error = xfs_setsize_buftarg(mp->m_rtdev_targp, in xfs_setup_devices()
485 mp->m_sb.sb_sectsize); in xfs_setup_devices()
495 struct xfs_mount *mp) in xfs_init_mount_workqueues() argument
497 mp->m_buf_workqueue = alloc_workqueue("xfs-buf/%s", in xfs_init_mount_workqueues()
498 WQ_MEM_RECLAIM|WQ_FREEZABLE, 1, mp->m_super->s_id); in xfs_init_mount_workqueues()
499 if (!mp->m_buf_workqueue) in xfs_init_mount_workqueues()
502 mp->m_unwritten_workqueue = alloc_workqueue("xfs-conv/%s", in xfs_init_mount_workqueues()
503 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
504 if (!mp->m_unwritten_workqueue) in xfs_init_mount_workqueues()
507 mp->m_cil_workqueue = alloc_workqueue("xfs-cil/%s", in xfs_init_mount_workqueues()
509 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
510 if (!mp->m_cil_workqueue) in xfs_init_mount_workqueues()
513 mp->m_reclaim_workqueue = alloc_workqueue("xfs-reclaim/%s", in xfs_init_mount_workqueues()
514 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
515 if (!mp->m_reclaim_workqueue) in xfs_init_mount_workqueues()
518 mp->m_eofblocks_workqueue = alloc_workqueue("xfs-eofblocks/%s", in xfs_init_mount_workqueues()
519 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
520 if (!mp->m_eofblocks_workqueue) in xfs_init_mount_workqueues()
523 mp->m_sync_workqueue = alloc_workqueue("xfs-sync/%s", WQ_FREEZABLE, 0, in xfs_init_mount_workqueues()
524 mp->m_super->s_id); in xfs_init_mount_workqueues()
525 if (!mp->m_sync_workqueue) in xfs_init_mount_workqueues()
531 destroy_workqueue(mp->m_eofblocks_workqueue); in xfs_init_mount_workqueues()
533 destroy_workqueue(mp->m_reclaim_workqueue); in xfs_init_mount_workqueues()
535 destroy_workqueue(mp->m_cil_workqueue); in xfs_init_mount_workqueues()
537 destroy_workqueue(mp->m_unwritten_workqueue); in xfs_init_mount_workqueues()
539 destroy_workqueue(mp->m_buf_workqueue); in xfs_init_mount_workqueues()
546 struct xfs_mount *mp) in xfs_destroy_mount_workqueues() argument
548 destroy_workqueue(mp->m_sync_workqueue); in xfs_destroy_mount_workqueues()
549 destroy_workqueue(mp->m_eofblocks_workqueue); in xfs_destroy_mount_workqueues()
550 destroy_workqueue(mp->m_reclaim_workqueue); in xfs_destroy_mount_workqueues()
551 destroy_workqueue(mp->m_cil_workqueue); in xfs_destroy_mount_workqueues()
552 destroy_workqueue(mp->m_unwritten_workqueue); in xfs_destroy_mount_workqueues()
553 destroy_workqueue(mp->m_buf_workqueue); in xfs_destroy_mount_workqueues()
560 struct xfs_mount *mp = container_of(work, struct xfs_mount, in xfs_flush_inodes_worker() local
562 struct super_block *sb = mp->m_super; in xfs_flush_inodes_worker()
578 struct xfs_mount *mp) in xfs_flush_inodes() argument
584 if (flush_work(&mp->m_flush_inodes_work)) in xfs_flush_inodes()
587 queue_work(mp->m_sync_workqueue, &mp->m_flush_inodes_work); in xfs_flush_inodes()
588 flush_work(&mp->m_flush_inodes_work); in xfs_flush_inodes()
674 struct xfs_mount *mp = ip->i_mount; in xfs_fs_dirty_inode() local
682 if (xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp)) in xfs_fs_dirty_inode()
747 struct xfs_mount *mp) in xfs_mount_free() argument
749 kfree(mp->m_rtname); in xfs_mount_free()
750 kfree(mp->m_logname); in xfs_mount_free()
751 kmem_free(mp); in xfs_mount_free()
759 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_sync_fs() local
768 error = xfs_log_force(mp, XFS_LOG_SYNC); in xfs_fs_sync_fs()
778 flush_delayed_work(&mp->m_log->l_work); in xfs_fs_sync_fs()
789 struct xfs_mount *mp = XFS_M(dentry->d_sb); in xfs_fs_statfs() local
790 xfs_sb_t *sbp = &mp->m_sb; in xfs_fs_statfs()
802 id = huge_encode_dev(mp->m_ddev_targp->bt_dev); in xfs_fs_statfs()
805 icount = percpu_counter_sum(&mp->m_icount); in xfs_fs_statfs()
806 ifree = percpu_counter_sum(&mp->m_ifree); in xfs_fs_statfs()
807 fdblocks = percpu_counter_sum(&mp->m_fdblocks); in xfs_fs_statfs()
809 spin_lock(&mp->m_sb_lock); in xfs_fs_statfs()
813 spin_unlock(&mp->m_sb_lock); in xfs_fs_statfs()
816 statp->f_bfree = max_t(int64_t, fdblocks - mp->m_alloc_set_aside, 0); in xfs_fs_statfs()
819 fakeinos = XFS_FSB_TO_INO(mp, statp->f_bfree); in xfs_fs_statfs()
821 if (M_IGEO(mp)->maxicount) in xfs_fs_statfs()
824 M_IGEO(mp)->maxicount); in xfs_fs_statfs()
837 ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD))) == in xfs_fs_statfs()
841 if (XFS_IS_REALTIME_MOUNT(mp) && in xfs_fs_statfs()
852 xfs_save_resvblks(struct xfs_mount *mp) in xfs_save_resvblks() argument
856 mp->m_resblks_save = mp->m_resblks; in xfs_save_resvblks()
857 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_save_resvblks()
861 xfs_restore_resvblks(struct xfs_mount *mp) in xfs_restore_resvblks() argument
865 if (mp->m_resblks_save) { in xfs_restore_resvblks()
866 resblks = mp->m_resblks_save; in xfs_restore_resvblks()
867 mp->m_resblks_save = 0; in xfs_restore_resvblks()
869 resblks = xfs_default_resblks(mp); in xfs_restore_resvblks()
871 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_restore_resvblks()
889 struct xfs_mount *mp) in xfs_quiesce_attr() argument
893 cancel_delayed_work_sync(&mp->m_log->l_work); in xfs_quiesce_attr()
896 xfs_log_force(mp, XFS_LOG_SYNC); in xfs_quiesce_attr()
900 error = xfs_log_sbcount(mp); in xfs_quiesce_attr()
902 xfs_warn(mp, "xfs_attr_quiesce: failed to log sb changes. " in xfs_quiesce_attr()
904 xfs_log_quiesce(mp); in xfs_quiesce_attr()
917 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_freeze() local
927 xfs_stop_block_reaping(mp); in xfs_fs_freeze()
928 xfs_save_resvblks(mp); in xfs_fs_freeze()
929 xfs_quiesce_attr(mp); in xfs_fs_freeze()
930 ret = xfs_sync_sb(mp, true); in xfs_fs_freeze()
939 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_unfreeze() local
941 xfs_restore_resvblks(mp); in xfs_fs_unfreeze()
942 xfs_log_work_queue(mp); in xfs_fs_unfreeze()
943 xfs_start_block_reaping(mp); in xfs_fs_unfreeze()
953 struct xfs_mount *mp) in xfs_finish_flags() argument
955 int ronly = (mp->m_flags & XFS_MOUNT_RDONLY); in xfs_finish_flags()
958 if (xfs_sb_version_haslogv2(&mp->m_sb)) { in xfs_finish_flags()
959 if (mp->m_logbsize <= 0 && in xfs_finish_flags()
960 mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
961 mp->m_logbsize = mp->m_sb.sb_logsunit; in xfs_finish_flags()
962 } else if (mp->m_logbsize > 0 && in xfs_finish_flags()
963 mp->m_logbsize < mp->m_sb.sb_logsunit) { in xfs_finish_flags()
964 xfs_warn(mp, in xfs_finish_flags()
970 if (mp->m_logbsize > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
971 xfs_warn(mp, in xfs_finish_flags()
980 if (xfs_sb_version_hascrc(&mp->m_sb) && in xfs_finish_flags()
981 (mp->m_flags & XFS_MOUNT_NOATTR2)) { in xfs_finish_flags()
982 xfs_warn(mp, "Cannot mount a V5 filesystem as noattr2. " in xfs_finish_flags()
991 if (xfs_sb_version_hasattr2(&mp->m_sb) && in xfs_finish_flags()
992 !(mp->m_flags & XFS_MOUNT_NOATTR2)) in xfs_finish_flags()
993 mp->m_flags |= XFS_MOUNT_ATTR2; in xfs_finish_flags()
998 if ((mp->m_sb.sb_flags & XFS_SBF_READONLY) && !ronly) { in xfs_finish_flags()
999 xfs_warn(mp, in xfs_finish_flags()
1004 if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) && in xfs_finish_flags()
1005 (mp->m_qflags & (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE)) && in xfs_finish_flags()
1006 !xfs_sb_version_has_pquotino(&mp->m_sb)) { in xfs_finish_flags()
1007 xfs_warn(mp, in xfs_finish_flags()
1017 struct xfs_mount *mp) in xfs_init_percpu_counters() argument
1021 error = percpu_counter_init(&mp->m_icount, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1025 error = percpu_counter_init(&mp->m_ifree, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1029 error = percpu_counter_init(&mp->m_fdblocks, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1033 error = percpu_counter_init(&mp->m_delalloc_blks, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1040 percpu_counter_destroy(&mp->m_fdblocks); in xfs_init_percpu_counters()
1042 percpu_counter_destroy(&mp->m_ifree); in xfs_init_percpu_counters()
1044 percpu_counter_destroy(&mp->m_icount); in xfs_init_percpu_counters()
1050 struct xfs_mount *mp) in xfs_reinit_percpu_counters() argument
1052 percpu_counter_set(&mp->m_icount, mp->m_sb.sb_icount); in xfs_reinit_percpu_counters()
1053 percpu_counter_set(&mp->m_ifree, mp->m_sb.sb_ifree); in xfs_reinit_percpu_counters()
1054 percpu_counter_set(&mp->m_fdblocks, mp->m_sb.sb_fdblocks); in xfs_reinit_percpu_counters()
1059 struct xfs_mount *mp) in xfs_destroy_percpu_counters() argument
1061 percpu_counter_destroy(&mp->m_icount); in xfs_destroy_percpu_counters()
1062 percpu_counter_destroy(&mp->m_ifree); in xfs_destroy_percpu_counters()
1063 percpu_counter_destroy(&mp->m_fdblocks); in xfs_destroy_percpu_counters()
1064 ASSERT(XFS_FORCED_SHUTDOWN(mp) || in xfs_destroy_percpu_counters()
1065 percpu_counter_sum(&mp->m_delalloc_blks) == 0); in xfs_destroy_percpu_counters()
1066 percpu_counter_destroy(&mp->m_delalloc_blks); in xfs_destroy_percpu_counters()
1073 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_put_super() local
1079 xfs_notice(mp, "Unmounting Filesystem"); in xfs_fs_put_super()
1080 xfs_filestream_unmount(mp); in xfs_fs_put_super()
1081 xfs_unmountfs(mp); in xfs_fs_put_super()
1083 xfs_freesb(mp); in xfs_fs_put_super()
1084 free_percpu(mp->m_stats.xs_stats); in xfs_fs_put_super()
1085 xfs_destroy_percpu_counters(mp); in xfs_fs_put_super()
1086 xfs_destroy_mount_workqueues(mp); in xfs_fs_put_super()
1087 xfs_close_devices(mp); in xfs_fs_put_super()
1090 xfs_mount_free(mp); in xfs_fs_put_super()
1181 * NOTE: mp->m_super is NULL here!
1343 struct xfs_mount *mp) in xfs_fc_validate_params() argument
1348 if ((mp->m_flags & XFS_MOUNT_NORECOVERY) && in xfs_fc_validate_params()
1349 !(mp->m_flags & XFS_MOUNT_RDONLY)) { in xfs_fc_validate_params()
1350 xfs_warn(mp, "no-recovery mounts must be read-only."); in xfs_fc_validate_params()
1354 if ((mp->m_flags & XFS_MOUNT_NOALIGN) && in xfs_fc_validate_params()
1355 (mp->m_dalign || mp->m_swidth)) { in xfs_fc_validate_params()
1356 xfs_warn(mp, in xfs_fc_validate_params()
1361 if (!IS_ENABLED(CONFIG_XFS_QUOTA) && mp->m_qflags != 0) { in xfs_fc_validate_params()
1362 xfs_warn(mp, "quota support not available in this kernel."); in xfs_fc_validate_params()
1366 if ((mp->m_dalign && !mp->m_swidth) || in xfs_fc_validate_params()
1367 (!mp->m_dalign && mp->m_swidth)) { in xfs_fc_validate_params()
1368 xfs_warn(mp, "sunit and swidth must be specified together"); in xfs_fc_validate_params()
1372 if (mp->m_dalign && (mp->m_swidth % mp->m_dalign != 0)) { in xfs_fc_validate_params()
1373 xfs_warn(mp, in xfs_fc_validate_params()
1375 mp->m_swidth, mp->m_dalign); in xfs_fc_validate_params()
1379 if (mp->m_logbufs != -1 && in xfs_fc_validate_params()
1380 mp->m_logbufs != 0 && in xfs_fc_validate_params()
1381 (mp->m_logbufs < XLOG_MIN_ICLOGS || in xfs_fc_validate_params()
1382 mp->m_logbufs > XLOG_MAX_ICLOGS)) { in xfs_fc_validate_params()
1383 xfs_warn(mp, "invalid logbufs value: %d [not %d-%d]", in xfs_fc_validate_params()
1384 mp->m_logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS); in xfs_fc_validate_params()
1388 if (mp->m_logbsize != -1 && in xfs_fc_validate_params()
1389 mp->m_logbsize != 0 && in xfs_fc_validate_params()
1390 (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE || in xfs_fc_validate_params()
1391 mp->m_logbsize > XLOG_MAX_RECORD_BSIZE || in xfs_fc_validate_params()
1392 !is_power_of_2(mp->m_logbsize))) { in xfs_fc_validate_params()
1393 xfs_warn(mp, in xfs_fc_validate_params()
1395 mp->m_logbsize); in xfs_fc_validate_params()
1399 if ((mp->m_flags & XFS_MOUNT_ALLOCSIZE) && in xfs_fc_validate_params()
1400 (mp->m_allocsize_log > XFS_MAX_IO_LOG || in xfs_fc_validate_params()
1401 mp->m_allocsize_log < XFS_MIN_IO_LOG)) { in xfs_fc_validate_params()
1402 xfs_warn(mp, "invalid log iosize: %d [not %d-%d]", in xfs_fc_validate_params()
1403 mp->m_allocsize_log, XFS_MIN_IO_LOG, XFS_MAX_IO_LOG); in xfs_fc_validate_params()
1415 struct xfs_mount *mp = sb->s_fs_info; in xfs_fc_fill_super() local
1419 mp->m_super = sb; in xfs_fc_fill_super()
1421 error = xfs_fc_validate_params(mp); in xfs_fc_fill_super()
1440 xfs_notice(mp, "Delaying mount for %d seconds.", in xfs_fc_fill_super()
1448 error = xfs_open_devices(mp); in xfs_fc_fill_super()
1452 error = xfs_init_mount_workqueues(mp); in xfs_fc_fill_super()
1456 error = xfs_init_percpu_counters(mp); in xfs_fc_fill_super()
1461 mp->m_stats.xs_stats = alloc_percpu(struct xfsstats); in xfs_fc_fill_super()
1462 if (!mp->m_stats.xs_stats) { in xfs_fc_fill_super()
1467 error = xfs_readsb(mp, flags); in xfs_fc_fill_super()
1471 error = xfs_finish_flags(mp); in xfs_fc_fill_super()
1475 error = xfs_setup_devices(mp); in xfs_fc_fill_super()
1480 if (!xfs_sb_version_hascrc(&mp->m_sb)) { in xfs_fc_fill_super()
1482 xfs_warn_once(mp, in xfs_fc_fill_super()
1485 xfs_warn(mp, in xfs_fc_fill_super()
1503 if (XFS_B_TO_FSBT(mp, MAX_LFS_FILESIZE) > XFS_MAX_FILEOFF) { in xfs_fc_fill_super()
1504 xfs_warn(mp, in xfs_fc_fill_super()
1506 XFS_B_TO_FSBT(mp, MAX_LFS_FILESIZE), in xfs_fc_fill_super()
1512 error = xfs_filestream_mount(mp); in xfs_fc_fill_super()
1521 sb->s_blocksize = mp->m_sb.sb_blocksize; in xfs_fc_fill_super()
1526 if (xfs_sb_version_hasbigtime(&mp->m_sb)) { in xfs_fc_fill_super()
1533 trace_xfs_inode_timestamp_range(mp, sb->s_time_min, sb->s_time_max); in xfs_fc_fill_super()
1539 if (XFS_SB_VERSION_NUM(&mp->m_sb) == XFS_SB_VERSION_5) in xfs_fc_fill_super()
1542 if (xfs_sb_version_hasbigtime(&mp->m_sb)) in xfs_fc_fill_super()
1543 xfs_warn(mp, in xfs_fc_fill_super()
1546 if (mp->m_flags & XFS_MOUNT_DAX_ALWAYS) { in xfs_fc_fill_super()
1549 xfs_warn(mp, in xfs_fc_fill_super()
1552 datadev_is_dax = bdev_dax_supported(mp->m_ddev_targp->bt_bdev, in xfs_fc_fill_super()
1554 if (mp->m_rtdev_targp) in xfs_fc_fill_super()
1556 mp->m_rtdev_targp->bt_bdev, sb->s_blocksize); in xfs_fc_fill_super()
1558 xfs_alert(mp, in xfs_fc_fill_super()
1560 xfs_mount_set_dax_mode(mp, XFS_DAX_NEVER); in xfs_fc_fill_super()
1562 if (xfs_sb_version_hasreflink(&mp->m_sb)) { in xfs_fc_fill_super()
1563 xfs_alert(mp, in xfs_fc_fill_super()
1570 if (mp->m_flags & XFS_MOUNT_DISCARD) { in xfs_fc_fill_super()
1574 xfs_warn(mp, "mounting with \"discard\" option, but " in xfs_fc_fill_super()
1576 mp->m_flags &= ~XFS_MOUNT_DISCARD; in xfs_fc_fill_super()
1580 if (xfs_sb_version_hasreflink(&mp->m_sb)) { in xfs_fc_fill_super()
1581 if (mp->m_sb.sb_rblocks) { in xfs_fc_fill_super()
1582 xfs_alert(mp, in xfs_fc_fill_super()
1589 xfs_info(mp, "using DEBUG-only always_cow mode."); in xfs_fc_fill_super()
1590 mp->m_always_cow = true; in xfs_fc_fill_super()
1594 if (xfs_sb_version_hasrmapbt(&mp->m_sb) && mp->m_sb.sb_rblocks) { in xfs_fc_fill_super()
1595 xfs_alert(mp, in xfs_fc_fill_super()
1601 if (xfs_sb_version_hasinobtcounts(&mp->m_sb)) in xfs_fc_fill_super()
1602 xfs_warn(mp, in xfs_fc_fill_super()
1605 error = xfs_mountfs(mp); in xfs_fc_fill_super()
1609 root = igrab(VFS_I(mp->m_rootip)); in xfs_fc_fill_super()
1623 xfs_filestream_unmount(mp); in xfs_fc_fill_super()
1625 xfs_freesb(mp); in xfs_fc_fill_super()
1627 free_percpu(mp->m_stats.xs_stats); in xfs_fc_fill_super()
1629 xfs_destroy_percpu_counters(mp); in xfs_fc_fill_super()
1631 xfs_destroy_mount_workqueues(mp); in xfs_fc_fill_super()
1633 xfs_close_devices(mp); in xfs_fc_fill_super()
1636 xfs_mount_free(mp); in xfs_fc_fill_super()
1640 xfs_filestream_unmount(mp); in xfs_fc_fill_super()
1641 xfs_unmountfs(mp); in xfs_fc_fill_super()
1654 struct xfs_mount *mp) in xfs_remount_rw() argument
1656 struct xfs_sb *sbp = &mp->m_sb; in xfs_remount_rw()
1659 if (mp->m_flags & XFS_MOUNT_NORECOVERY) { in xfs_remount_rw()
1660 xfs_warn(mp, in xfs_remount_rw()
1667 xfs_warn(mp, in xfs_remount_rw()
1674 mp->m_flags &= ~XFS_MOUNT_RDONLY; in xfs_remount_rw()
1680 if (mp->m_update_sb) { in xfs_remount_rw()
1681 error = xfs_sync_sb(mp, false); in xfs_remount_rw()
1683 xfs_warn(mp, "failed to write sb changes"); in xfs_remount_rw()
1686 mp->m_update_sb = false; in xfs_remount_rw()
1693 xfs_restore_resvblks(mp); in xfs_remount_rw()
1694 xfs_log_work_queue(mp); in xfs_remount_rw()
1697 error = xfs_reflink_recover_cow(mp); in xfs_remount_rw()
1699 xfs_err(mp, in xfs_remount_rw()
1701 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_remount_rw()
1704 xfs_start_block_reaping(mp); in xfs_remount_rw()
1707 error = xfs_fs_reserve_ag_blocks(mp); in xfs_remount_rw()
1716 struct xfs_mount *mp) in xfs_remount_ro() argument
1724 error = sync_filesystem(mp->m_super); in xfs_remount_ro()
1732 xfs_stop_block_reaping(mp); in xfs_remount_ro()
1740 error = xfs_icache_free_cowblocks(mp, &eofb); in xfs_remount_ro()
1742 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_remount_ro()
1747 error = xfs_fs_unreserve_ag_blocks(mp); in xfs_remount_ro()
1749 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_remount_ro()
1760 xfs_save_resvblks(mp); in xfs_remount_ro()
1762 xfs_quiesce_attr(mp); in xfs_remount_ro()
1763 mp->m_flags |= XFS_MOUNT_RDONLY; in xfs_remount_ro()
1784 struct xfs_mount *mp = XFS_M(fc->root->d_sb); in xfs_fc_reconfigure() local
1786 xfs_sb_t *sbp = &mp->m_sb; in xfs_fc_reconfigure()
1791 if (XFS_SB_VERSION_NUM(&mp->m_sb) == XFS_SB_VERSION_5) in xfs_fc_reconfigure()
1799 if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && in xfs_fc_reconfigure()
1801 mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; in xfs_fc_reconfigure()
1802 mp->m_maxagi = xfs_set_inode_alloc(mp, sbp->sb_agcount); in xfs_fc_reconfigure()
1806 if (!(mp->m_flags & XFS_MOUNT_SMALL_INUMS) && in xfs_fc_reconfigure()
1808 mp->m_flags |= XFS_MOUNT_SMALL_INUMS; in xfs_fc_reconfigure()
1809 mp->m_maxagi = xfs_set_inode_alloc(mp, sbp->sb_agcount); in xfs_fc_reconfigure()
1813 if ((mp->m_flags & XFS_MOUNT_RDONLY) && !(flags & SB_RDONLY)) { in xfs_fc_reconfigure()
1814 error = xfs_remount_rw(mp); in xfs_fc_reconfigure()
1820 if (!(mp->m_flags & XFS_MOUNT_RDONLY) && (flags & SB_RDONLY)) { in xfs_fc_reconfigure()
1821 error = xfs_remount_ro(mp); in xfs_fc_reconfigure()
1832 struct xfs_mount *mp = fc->s_fs_info; in xfs_fc_free() local
1835 * mp is stored in the fs_context when it is initialized. in xfs_fc_free()
1836 * mp is transferred to the superblock on a successful mount, in xfs_fc_free()
1840 if (mp) in xfs_fc_free()
1841 xfs_mount_free(mp); in xfs_fc_free()
1854 struct xfs_mount *mp; in xfs_init_fs_context() local
1856 mp = kmem_alloc(sizeof(struct xfs_mount), KM_ZERO); in xfs_init_fs_context()
1857 if (!mp) in xfs_init_fs_context()
1860 spin_lock_init(&mp->m_sb_lock); in xfs_init_fs_context()
1861 spin_lock_init(&mp->m_agirotor_lock); in xfs_init_fs_context()
1862 INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC); in xfs_init_fs_context()
1863 spin_lock_init(&mp->m_perag_lock); in xfs_init_fs_context()
1864 mutex_init(&mp->m_growlock); in xfs_init_fs_context()
1865 INIT_WORK(&mp->m_flush_inodes_work, xfs_flush_inodes_worker); in xfs_init_fs_context()
1866 INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker); in xfs_init_fs_context()
1867 INIT_DELAYED_WORK(&mp->m_eofblocks_work, xfs_eofblocks_worker); in xfs_init_fs_context()
1868 INIT_DELAYED_WORK(&mp->m_cowblocks_work, xfs_cowblocks_worker); in xfs_init_fs_context()
1869 mp->m_kobj.kobject.kset = xfs_kset; in xfs_init_fs_context()
1876 mp->m_finobt_nores = true; in xfs_init_fs_context()
1881 mp->m_logbufs = -1; in xfs_init_fs_context()
1882 mp->m_logbsize = -1; in xfs_init_fs_context()
1883 mp->m_allocsize_log = 16; /* 64k */ in xfs_init_fs_context()
1889 mp->m_flags |= XFS_MOUNT_RDONLY; in xfs_init_fs_context()
1891 mp->m_flags |= XFS_MOUNT_DIRSYNC; in xfs_init_fs_context()
1893 mp->m_flags |= XFS_MOUNT_WSYNC; in xfs_init_fs_context()
1895 fc->s_fs_info = mp; in xfs_init_fs_context()