Lines Matching refs:mp
67 struct xfs_mount *mp, in xfs_mount_set_dax_mode() argument
72 mp->m_features &= ~(XFS_FEAT_DAX_ALWAYS | XFS_FEAT_DAX_NEVER); in xfs_mount_set_dax_mode()
75 mp->m_features |= XFS_FEAT_DAX_ALWAYS; in xfs_mount_set_dax_mode()
76 mp->m_features &= ~XFS_FEAT_DAX_NEVER; in xfs_mount_set_dax_mode()
79 mp->m_features |= XFS_FEAT_DAX_NEVER; in xfs_mount_set_dax_mode()
80 mp->m_features &= ~XFS_FEAT_DAX_ALWAYS; in xfs_mount_set_dax_mode()
179 struct xfs_mount *mp = XFS_M(root->d_sb); in xfs_fs_show_options() local
183 if (mp->m_features & xfs_infop->flag) in xfs_fs_show_options()
187 seq_printf(m, ",inode%d", xfs_has_small_inums(mp) ? 32 : 64); in xfs_fs_show_options()
189 if (xfs_has_allocsize(mp)) in xfs_fs_show_options()
191 (1 << mp->m_allocsize_log) >> 10); in xfs_fs_show_options()
193 if (mp->m_logbufs > 0) in xfs_fs_show_options()
194 seq_printf(m, ",logbufs=%d", mp->m_logbufs); in xfs_fs_show_options()
195 if (mp->m_logbsize > 0) in xfs_fs_show_options()
196 seq_printf(m, ",logbsize=%dk", mp->m_logbsize >> 10); in xfs_fs_show_options()
198 if (mp->m_logname) in xfs_fs_show_options()
199 seq_show_option(m, "logdev", mp->m_logname); in xfs_fs_show_options()
200 if (mp->m_rtname) in xfs_fs_show_options()
201 seq_show_option(m, "rtdev", mp->m_rtname); in xfs_fs_show_options()
203 if (mp->m_dalign > 0) in xfs_fs_show_options()
205 (int)XFS_FSB_TO_BB(mp, mp->m_dalign)); in xfs_fs_show_options()
206 if (mp->m_swidth > 0) in xfs_fs_show_options()
208 (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); in xfs_fs_show_options()
210 if (mp->m_qflags & XFS_UQUOTA_ENFD) in xfs_fs_show_options()
212 else if (mp->m_qflags & XFS_UQUOTA_ACCT) in xfs_fs_show_options()
215 if (mp->m_qflags & XFS_PQUOTA_ENFD) in xfs_fs_show_options()
217 else if (mp->m_qflags & XFS_PQUOTA_ACCT) in xfs_fs_show_options()
220 if (mp->m_qflags & XFS_GQUOTA_ENFD) in xfs_fs_show_options()
222 else if (mp->m_qflags & XFS_GQUOTA_ACCT) in xfs_fs_show_options()
225 if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) in xfs_fs_show_options()
274 struct xfs_mount *mp, in xfs_set_inode_alloc() argument
279 xfs_sb_t *sbp = &mp->m_sb; in xfs_set_inode_alloc()
288 if (M_IGEO(mp)->maxicount) { in xfs_set_inode_alloc()
301 agino = XFS_AGB_TO_AGINO(mp, sbp->sb_agblocks - 1); in xfs_set_inode_alloc()
302 ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino); in xfs_set_inode_alloc()
309 if (xfs_has_small_inums(mp) && ino > XFS_MAXINUMBER_32) in xfs_set_inode_alloc()
310 set_bit(XFS_OPSTATE_INODE32, &mp->m_opstate); in xfs_set_inode_alloc()
312 clear_bit(XFS_OPSTATE_INODE32, &mp->m_opstate); in xfs_set_inode_alloc()
317 ino = XFS_AGINO_TO_INO(mp, index, agino); in xfs_set_inode_alloc()
319 pag = xfs_perag_get(mp, index); in xfs_set_inode_alloc()
325 return xfs_is_inode32(mp) ? maxagi : agcount; in xfs_set_inode_alloc()
330 struct xfs_mount *mp) in xfs_setup_dax_always() argument
332 if (!mp->m_ddev_targp->bt_daxdev && in xfs_setup_dax_always()
333 (!mp->m_rtdev_targp || !mp->m_rtdev_targp->bt_daxdev)) { in xfs_setup_dax_always()
334 xfs_alert(mp, in xfs_setup_dax_always()
339 if (mp->m_super->s_blocksize != PAGE_SIZE) { in xfs_setup_dax_always()
340 xfs_alert(mp, in xfs_setup_dax_always()
345 if (xfs_has_reflink(mp) && in xfs_setup_dax_always()
346 bdev_is_partition(mp->m_ddev_targp->bt_bdev)) { in xfs_setup_dax_always()
347 xfs_alert(mp, in xfs_setup_dax_always()
352 xfs_warn(mp, "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); in xfs_setup_dax_always()
356 xfs_mount_set_dax_mode(mp, XFS_DAX_NEVER); in xfs_setup_dax_always()
362 xfs_mount_t *mp, in xfs_blkdev_get() argument
369 mp->m_super, &fs_holder_ops); in xfs_blkdev_get()
372 xfs_warn(mp, "Invalid device [%s], error=%d", name, error); in xfs_blkdev_get()
380 struct xfs_mount *mp) in xfs_shutdown_devices() argument
408 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { in xfs_shutdown_devices()
409 blkdev_issue_flush(mp->m_logdev_targp->bt_bdev); in xfs_shutdown_devices()
410 invalidate_bdev(mp->m_logdev_targp->bt_bdev); in xfs_shutdown_devices()
412 if (mp->m_rtdev_targp) { in xfs_shutdown_devices()
413 blkdev_issue_flush(mp->m_rtdev_targp->bt_bdev); in xfs_shutdown_devices()
414 invalidate_bdev(mp->m_rtdev_targp->bt_bdev); in xfs_shutdown_devices()
416 blkdev_issue_flush(mp->m_ddev_targp->bt_bdev); in xfs_shutdown_devices()
417 invalidate_bdev(mp->m_ddev_targp->bt_bdev); in xfs_shutdown_devices()
432 struct xfs_mount *mp) in xfs_open_devices() argument
434 struct super_block *sb = mp->m_super; in xfs_open_devices()
448 if (mp->m_logname) { in xfs_open_devices()
449 error = xfs_blkdev_get(mp, mp->m_logname, &logdev); in xfs_open_devices()
454 if (mp->m_rtname) { in xfs_open_devices()
455 error = xfs_blkdev_get(mp, mp->m_rtname, &rtdev); in xfs_open_devices()
460 xfs_warn(mp, in xfs_open_devices()
471 mp->m_ddev_targp = xfs_alloc_buftarg(mp, ddev); in xfs_open_devices()
472 if (!mp->m_ddev_targp) in xfs_open_devices()
476 mp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev); in xfs_open_devices()
477 if (!mp->m_rtdev_targp) in xfs_open_devices()
482 mp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev); in xfs_open_devices()
483 if (!mp->m_logdev_targp) in xfs_open_devices()
486 mp->m_logdev_targp = mp->m_ddev_targp; in xfs_open_devices()
495 if (mp->m_rtdev_targp) in xfs_open_devices()
496 xfs_free_buftarg(mp->m_rtdev_targp); in xfs_open_devices()
498 xfs_free_buftarg(mp->m_ddev_targp); in xfs_open_devices()
513 struct xfs_mount *mp) in xfs_setup_devices() argument
517 error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_sectsize); in xfs_setup_devices()
521 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { in xfs_setup_devices()
524 if (xfs_has_sector(mp)) in xfs_setup_devices()
525 log_sector_size = mp->m_sb.sb_logsectsize; in xfs_setup_devices()
526 error = xfs_setsize_buftarg(mp->m_logdev_targp, in xfs_setup_devices()
531 if (mp->m_rtdev_targp) { in xfs_setup_devices()
532 error = xfs_setsize_buftarg(mp->m_rtdev_targp, in xfs_setup_devices()
533 mp->m_sb.sb_sectsize); in xfs_setup_devices()
543 struct xfs_mount *mp) in xfs_init_mount_workqueues() argument
545 mp->m_buf_workqueue = alloc_workqueue("xfs-buf/%s", in xfs_init_mount_workqueues()
547 1, mp->m_super->s_id); in xfs_init_mount_workqueues()
548 if (!mp->m_buf_workqueue) in xfs_init_mount_workqueues()
551 mp->m_unwritten_workqueue = alloc_workqueue("xfs-conv/%s", in xfs_init_mount_workqueues()
553 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
554 if (!mp->m_unwritten_workqueue) in xfs_init_mount_workqueues()
557 mp->m_reclaim_workqueue = alloc_workqueue("xfs-reclaim/%s", in xfs_init_mount_workqueues()
559 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
560 if (!mp->m_reclaim_workqueue) in xfs_init_mount_workqueues()
563 mp->m_blockgc_wq = alloc_workqueue("xfs-blockgc/%s", in xfs_init_mount_workqueues()
565 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
566 if (!mp->m_blockgc_wq) in xfs_init_mount_workqueues()
569 mp->m_inodegc_wq = alloc_workqueue("xfs-inodegc/%s", in xfs_init_mount_workqueues()
571 1, mp->m_super->s_id); in xfs_init_mount_workqueues()
572 if (!mp->m_inodegc_wq) in xfs_init_mount_workqueues()
575 mp->m_sync_workqueue = alloc_workqueue("xfs-sync/%s", in xfs_init_mount_workqueues()
576 XFS_WQFLAGS(WQ_FREEZABLE), 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
577 if (!mp->m_sync_workqueue) in xfs_init_mount_workqueues()
583 destroy_workqueue(mp->m_inodegc_wq); in xfs_init_mount_workqueues()
585 destroy_workqueue(mp->m_blockgc_wq); in xfs_init_mount_workqueues()
587 destroy_workqueue(mp->m_reclaim_workqueue); in xfs_init_mount_workqueues()
589 destroy_workqueue(mp->m_unwritten_workqueue); in xfs_init_mount_workqueues()
591 destroy_workqueue(mp->m_buf_workqueue); in xfs_init_mount_workqueues()
598 struct xfs_mount *mp) in xfs_destroy_mount_workqueues() argument
600 destroy_workqueue(mp->m_sync_workqueue); in xfs_destroy_mount_workqueues()
601 destroy_workqueue(mp->m_blockgc_wq); in xfs_destroy_mount_workqueues()
602 destroy_workqueue(mp->m_inodegc_wq); in xfs_destroy_mount_workqueues()
603 destroy_workqueue(mp->m_reclaim_workqueue); in xfs_destroy_mount_workqueues()
604 destroy_workqueue(mp->m_unwritten_workqueue); in xfs_destroy_mount_workqueues()
605 destroy_workqueue(mp->m_buf_workqueue); in xfs_destroy_mount_workqueues()
612 struct xfs_mount *mp = container_of(work, struct xfs_mount, in xfs_flush_inodes_worker() local
614 struct super_block *sb = mp->m_super; in xfs_flush_inodes_worker()
630 struct xfs_mount *mp) in xfs_flush_inodes() argument
636 if (flush_work(&mp->m_flush_inodes_work)) in xfs_flush_inodes()
639 queue_work(mp->m_sync_workqueue, &mp->m_flush_inodes_work); in xfs_flush_inodes()
640 flush_work(&mp->m_flush_inodes_work); in xfs_flush_inodes()
676 struct xfs_mount *mp = ip->i_mount; in xfs_fs_dirty_inode() local
690 if (xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp)) in xfs_fs_dirty_inode()
753 struct xfs_mount *mp) in xfs_mount_free() argument
759 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) in xfs_mount_free()
760 xfs_free_buftarg(mp->m_logdev_targp); in xfs_mount_free()
761 if (mp->m_rtdev_targp) in xfs_mount_free()
762 xfs_free_buftarg(mp->m_rtdev_targp); in xfs_mount_free()
763 if (mp->m_ddev_targp) in xfs_mount_free()
764 xfs_free_buftarg(mp->m_ddev_targp); in xfs_mount_free()
766 debugfs_remove(mp->m_debugfs); in xfs_mount_free()
767 kfree(mp->m_rtname); in xfs_mount_free()
768 kfree(mp->m_logname); in xfs_mount_free()
769 kmem_free(mp); in xfs_mount_free()
777 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_sync_fs() local
780 trace_xfs_fs_sync_fs(mp, __return_address); in xfs_fs_sync_fs()
788 error = xfs_log_force(mp, XFS_LOG_SYNC); in xfs_fs_sync_fs()
798 flush_delayed_work(&mp->m_log->l_work); in xfs_fs_sync_fs()
816 xfs_inodegc_stop(mp); in xfs_fs_sync_fs()
817 xfs_blockgc_stop(mp); in xfs_fs_sync_fs()
828 struct xfs_mount *mp = XFS_M(dentry->d_sb); in xfs_fs_statfs() local
829 xfs_sb_t *sbp = &mp->m_sb; in xfs_fs_statfs()
842 xfs_inodegc_push(mp); in xfs_fs_statfs()
847 id = huge_encode_dev(mp->m_ddev_targp->bt_dev); in xfs_fs_statfs()
850 icount = percpu_counter_sum(&mp->m_icount); in xfs_fs_statfs()
851 ifree = percpu_counter_sum(&mp->m_ifree); in xfs_fs_statfs()
852 fdblocks = percpu_counter_sum(&mp->m_fdblocks); in xfs_fs_statfs()
854 spin_lock(&mp->m_sb_lock); in xfs_fs_statfs()
858 spin_unlock(&mp->m_sb_lock); in xfs_fs_statfs()
862 fdblocks - xfs_fdblocks_unavailable(mp)); in xfs_fs_statfs()
865 fakeinos = XFS_FSB_TO_INO(mp, statp->f_bfree); in xfs_fs_statfs()
867 if (M_IGEO(mp)->maxicount) in xfs_fs_statfs()
870 M_IGEO(mp)->maxicount); in xfs_fs_statfs()
883 ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD))) == in xfs_fs_statfs()
887 if (XFS_IS_REALTIME_MOUNT(mp) && in xfs_fs_statfs()
892 freertx = percpu_counter_sum_positive(&mp->m_frextents); in xfs_fs_statfs()
900 xfs_save_resvblks(struct xfs_mount *mp) in xfs_save_resvblks() argument
904 mp->m_resblks_save = mp->m_resblks; in xfs_save_resvblks()
905 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_save_resvblks()
909 xfs_restore_resvblks(struct xfs_mount *mp) in xfs_restore_resvblks() argument
913 if (mp->m_resblks_save) { in xfs_restore_resvblks()
914 resblks = mp->m_resblks_save; in xfs_restore_resvblks()
915 mp->m_resblks_save = 0; in xfs_restore_resvblks()
917 resblks = xfs_default_resblks(mp); in xfs_restore_resvblks()
919 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_restore_resvblks()
932 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_freeze() local
942 xfs_save_resvblks(mp); in xfs_fs_freeze()
943 ret = xfs_log_quiesce(mp); in xfs_fs_freeze()
953 if (ret && !xfs_is_readonly(mp)) { in xfs_fs_freeze()
954 xfs_blockgc_start(mp); in xfs_fs_freeze()
955 xfs_inodegc_start(mp); in xfs_fs_freeze()
965 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_unfreeze() local
967 xfs_restore_resvblks(mp); in xfs_fs_unfreeze()
968 xfs_log_work_queue(mp); in xfs_fs_unfreeze()
976 if (!xfs_is_readonly(mp)) { in xfs_fs_unfreeze()
977 xfs_blockgc_start(mp); in xfs_fs_unfreeze()
978 xfs_inodegc_start(mp); in xfs_fs_unfreeze()
990 struct xfs_mount *mp) in xfs_finish_flags() argument
993 if (xfs_has_logv2(mp)) { in xfs_finish_flags()
994 if (mp->m_logbsize <= 0 && in xfs_finish_flags()
995 mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
996 mp->m_logbsize = mp->m_sb.sb_logsunit; in xfs_finish_flags()
997 } else if (mp->m_logbsize > 0 && in xfs_finish_flags()
998 mp->m_logbsize < mp->m_sb.sb_logsunit) { in xfs_finish_flags()
999 xfs_warn(mp, in xfs_finish_flags()
1005 if (mp->m_logbsize > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
1006 xfs_warn(mp, in xfs_finish_flags()
1015 if (xfs_has_crc(mp) && xfs_has_noattr2(mp)) { in xfs_finish_flags()
1016 xfs_warn(mp, "Cannot mount a V5 filesystem as noattr2. " in xfs_finish_flags()
1024 if ((mp->m_sb.sb_flags & XFS_SBF_READONLY) && !xfs_is_readonly(mp)) { in xfs_finish_flags()
1025 xfs_warn(mp, in xfs_finish_flags()
1030 if ((mp->m_qflags & XFS_GQUOTA_ACCT) && in xfs_finish_flags()
1031 (mp->m_qflags & XFS_PQUOTA_ACCT) && in xfs_finish_flags()
1032 !xfs_has_pquotino(mp)) { in xfs_finish_flags()
1033 xfs_warn(mp, in xfs_finish_flags()
1043 struct xfs_mount *mp) in xfs_init_percpu_counters() argument
1047 error = percpu_counter_init(&mp->m_icount, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1051 error = percpu_counter_init(&mp->m_ifree, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1055 error = percpu_counter_init(&mp->m_fdblocks, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1059 error = percpu_counter_init(&mp->m_delalloc_blks, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1063 error = percpu_counter_init(&mp->m_frextents, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1070 percpu_counter_destroy(&mp->m_delalloc_blks); in xfs_init_percpu_counters()
1072 percpu_counter_destroy(&mp->m_fdblocks); in xfs_init_percpu_counters()
1074 percpu_counter_destroy(&mp->m_ifree); in xfs_init_percpu_counters()
1076 percpu_counter_destroy(&mp->m_icount); in xfs_init_percpu_counters()
1082 struct xfs_mount *mp) in xfs_reinit_percpu_counters() argument
1084 percpu_counter_set(&mp->m_icount, mp->m_sb.sb_icount); in xfs_reinit_percpu_counters()
1085 percpu_counter_set(&mp->m_ifree, mp->m_sb.sb_ifree); in xfs_reinit_percpu_counters()
1086 percpu_counter_set(&mp->m_fdblocks, mp->m_sb.sb_fdblocks); in xfs_reinit_percpu_counters()
1087 percpu_counter_set(&mp->m_frextents, mp->m_sb.sb_frextents); in xfs_reinit_percpu_counters()
1092 struct xfs_mount *mp) in xfs_destroy_percpu_counters() argument
1094 percpu_counter_destroy(&mp->m_icount); in xfs_destroy_percpu_counters()
1095 percpu_counter_destroy(&mp->m_ifree); in xfs_destroy_percpu_counters()
1096 percpu_counter_destroy(&mp->m_fdblocks); in xfs_destroy_percpu_counters()
1097 ASSERT(xfs_is_shutdown(mp) || in xfs_destroy_percpu_counters()
1098 percpu_counter_sum(&mp->m_delalloc_blks) == 0); in xfs_destroy_percpu_counters()
1099 percpu_counter_destroy(&mp->m_delalloc_blks); in xfs_destroy_percpu_counters()
1100 percpu_counter_destroy(&mp->m_frextents); in xfs_destroy_percpu_counters()
1105 struct xfs_mount *mp) in xfs_inodegc_init_percpu() argument
1110 mp->m_inodegc = alloc_percpu(struct xfs_inodegc); in xfs_inodegc_init_percpu()
1111 if (!mp->m_inodegc) in xfs_inodegc_init_percpu()
1115 gc = per_cpu_ptr(mp->m_inodegc, cpu); in xfs_inodegc_init_percpu()
1117 gc->mp = mp; in xfs_inodegc_init_percpu()
1128 struct xfs_mount *mp) in xfs_inodegc_free_percpu() argument
1130 if (!mp->m_inodegc) in xfs_inodegc_free_percpu()
1132 free_percpu(mp->m_inodegc); in xfs_inodegc_free_percpu()
1139 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_put_super() local
1141 xfs_notice(mp, "Unmounting Filesystem %pU", &mp->m_sb.sb_uuid); in xfs_fs_put_super()
1142 xfs_filestream_unmount(mp); in xfs_fs_put_super()
1143 xfs_unmountfs(mp); in xfs_fs_put_super()
1145 xfs_freesb(mp); in xfs_fs_put_super()
1146 xchk_mount_stats_free(mp); in xfs_fs_put_super()
1147 free_percpu(mp->m_stats.xs_stats); in xfs_fs_put_super()
1148 xfs_inodegc_free_percpu(mp); in xfs_fs_put_super()
1149 xfs_destroy_percpu_counters(mp); in xfs_fs_put_super()
1150 xfs_destroy_mount_workqueues(mp); in xfs_fs_put_super()
1151 xfs_shutdown_devices(mp); in xfs_fs_put_super()
1407 struct xfs_mount *mp) in xfs_fs_validate_params() argument
1410 if (xfs_has_norecovery(mp) && !xfs_is_readonly(mp)) { in xfs_fs_validate_params()
1411 xfs_warn(mp, "no-recovery mounts must be read-only."); in xfs_fs_validate_params()
1419 if (xfs_has_attr2(mp) && xfs_has_noattr2(mp)) { in xfs_fs_validate_params()
1420 xfs_warn(mp, "attr2 and noattr2 cannot both be specified."); in xfs_fs_validate_params()
1425 if (xfs_has_noalign(mp) && (mp->m_dalign || mp->m_swidth)) { in xfs_fs_validate_params()
1426 xfs_warn(mp, in xfs_fs_validate_params()
1431 if (!IS_ENABLED(CONFIG_XFS_QUOTA) && mp->m_qflags != 0) { in xfs_fs_validate_params()
1432 xfs_warn(mp, "quota support not available in this kernel."); in xfs_fs_validate_params()
1436 if ((mp->m_dalign && !mp->m_swidth) || in xfs_fs_validate_params()
1437 (!mp->m_dalign && mp->m_swidth)) { in xfs_fs_validate_params()
1438 xfs_warn(mp, "sunit and swidth must be specified together"); in xfs_fs_validate_params()
1442 if (mp->m_dalign && (mp->m_swidth % mp->m_dalign != 0)) { in xfs_fs_validate_params()
1443 xfs_warn(mp, in xfs_fs_validate_params()
1445 mp->m_swidth, mp->m_dalign); in xfs_fs_validate_params()
1449 if (mp->m_logbufs != -1 && in xfs_fs_validate_params()
1450 mp->m_logbufs != 0 && in xfs_fs_validate_params()
1451 (mp->m_logbufs < XLOG_MIN_ICLOGS || in xfs_fs_validate_params()
1452 mp->m_logbufs > XLOG_MAX_ICLOGS)) { in xfs_fs_validate_params()
1453 xfs_warn(mp, "invalid logbufs value: %d [not %d-%d]", in xfs_fs_validate_params()
1454 mp->m_logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS); in xfs_fs_validate_params()
1458 if (mp->m_logbsize != -1 && in xfs_fs_validate_params()
1459 mp->m_logbsize != 0 && in xfs_fs_validate_params()
1460 (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE || in xfs_fs_validate_params()
1461 mp->m_logbsize > XLOG_MAX_RECORD_BSIZE || in xfs_fs_validate_params()
1462 !is_power_of_2(mp->m_logbsize))) { in xfs_fs_validate_params()
1463 xfs_warn(mp, in xfs_fs_validate_params()
1465 mp->m_logbsize); in xfs_fs_validate_params()
1469 if (xfs_has_allocsize(mp) && in xfs_fs_validate_params()
1470 (mp->m_allocsize_log > XFS_MAX_IO_LOG || in xfs_fs_validate_params()
1471 mp->m_allocsize_log < XFS_MIN_IO_LOG)) { in xfs_fs_validate_params()
1472 xfs_warn(mp, "invalid log iosize: %d [not %d-%d]", in xfs_fs_validate_params()
1473 mp->m_allocsize_log, XFS_MIN_IO_LOG, XFS_MAX_IO_LOG); in xfs_fs_validate_params()
1500 struct xfs_mount *mp = sb->s_fs_info; in xfs_fs_fill_super() local
1504 mp->m_super = sb; in xfs_fs_fill_super()
1512 set_bit(XFS_OPSTATE_READONLY, &mp->m_opstate); in xfs_fs_fill_super()
1514 mp->m_features |= XFS_FEAT_DIRSYNC; in xfs_fs_fill_super()
1516 mp->m_features |= XFS_FEAT_WSYNC; in xfs_fs_fill_super()
1518 error = xfs_fs_validate_params(mp); in xfs_fs_fill_super()
1537 xfs_notice(mp, "Delaying mount for %d seconds.", in xfs_fs_fill_super()
1545 error = xfs_open_devices(mp); in xfs_fs_fill_super()
1550 mp->m_debugfs = xfs_debugfs_mkdir(mp->m_super->s_id, in xfs_fs_fill_super()
1553 mp->m_debugfs = NULL; in xfs_fs_fill_super()
1556 error = xfs_init_mount_workqueues(mp); in xfs_fs_fill_super()
1560 error = xfs_init_percpu_counters(mp); in xfs_fs_fill_super()
1564 error = xfs_inodegc_init_percpu(mp); in xfs_fs_fill_super()
1569 mp->m_stats.xs_stats = alloc_percpu(struct xfsstats); in xfs_fs_fill_super()
1570 if (!mp->m_stats.xs_stats) { in xfs_fs_fill_super()
1575 error = xchk_mount_stats_alloc(mp); in xfs_fs_fill_super()
1579 error = xfs_readsb(mp, flags); in xfs_fs_fill_super()
1583 error = xfs_finish_flags(mp); in xfs_fs_fill_super()
1587 error = xfs_setup_devices(mp); in xfs_fs_fill_super()
1592 if (!xfs_has_crc(mp)) { in xfs_fs_fill_super()
1594 xfs_warn_once(mp, in xfs_fs_fill_super()
1597 xfs_warn(mp, in xfs_fs_fill_super()
1605 if (xfs_has_asciici(mp)) { in xfs_fs_fill_super()
1607 xfs_warn_once(mp, in xfs_fs_fill_super()
1610 xfs_warn(mp, in xfs_fs_fill_super()
1618 if (xfs_has_needsrepair(mp)) { in xfs_fs_fill_super()
1619 xfs_warn(mp, "Filesystem needs repair. Please run xfs_repair."); in xfs_fs_fill_super()
1629 if (mp->m_sb.sb_inprogress) { in xfs_fs_fill_super()
1630 xfs_warn(mp, "Offline file system operation in progress!"); in xfs_fs_fill_super()
1638 if (mp->m_sb.sb_blocksize > PAGE_SIZE) { in xfs_fs_fill_super()
1639 xfs_warn(mp, in xfs_fs_fill_super()
1642 mp->m_sb.sb_blocksize, PAGE_SIZE); in xfs_fs_fill_super()
1648 if (xfs_sb_validate_fsb_count(&mp->m_sb, mp->m_sb.sb_dblocks) || in xfs_fs_fill_super()
1649 xfs_sb_validate_fsb_count(&mp->m_sb, mp->m_sb.sb_rblocks)) { in xfs_fs_fill_super()
1650 xfs_warn(mp, in xfs_fs_fill_super()
1667 if (!xfs_verify_fileoff(mp, XFS_B_TO_FSBT(mp, MAX_LFS_FILESIZE))) { in xfs_fs_fill_super()
1668 xfs_warn(mp, in xfs_fs_fill_super()
1670 XFS_B_TO_FSBT(mp, MAX_LFS_FILESIZE), in xfs_fs_fill_super()
1676 error = xfs_filestream_mount(mp); in xfs_fs_fill_super()
1685 sb->s_blocksize = mp->m_sb.sb_blocksize; in xfs_fs_fill_super()
1690 if (xfs_has_bigtime(mp)) { in xfs_fs_fill_super()
1697 trace_xfs_inode_timestamp_range(mp, sb->s_time_min, sb->s_time_max); in xfs_fs_fill_super()
1703 if (xfs_has_crc(mp)) in xfs_fs_fill_super()
1706 if (xfs_has_dax_always(mp)) { in xfs_fs_fill_super()
1707 error = xfs_setup_dax_always(mp); in xfs_fs_fill_super()
1712 if (xfs_has_discard(mp) && !bdev_max_discard_sectors(sb->s_bdev)) { in xfs_fs_fill_super()
1713 xfs_warn(mp, in xfs_fs_fill_super()
1715 mp->m_features &= ~XFS_FEAT_DISCARD; in xfs_fs_fill_super()
1718 if (xfs_has_reflink(mp)) { in xfs_fs_fill_super()
1719 if (mp->m_sb.sb_rblocks) { in xfs_fs_fill_super()
1720 xfs_alert(mp, in xfs_fs_fill_super()
1727 xfs_info(mp, "using DEBUG-only always_cow mode."); in xfs_fs_fill_super()
1728 mp->m_always_cow = true; in xfs_fs_fill_super()
1732 if (xfs_has_rmapbt(mp) && mp->m_sb.sb_rblocks) { in xfs_fs_fill_super()
1733 xfs_alert(mp, in xfs_fs_fill_super()
1739 error = xfs_mountfs(mp); in xfs_fs_fill_super()
1743 root = igrab(VFS_I(mp->m_rootip)); in xfs_fs_fill_super()
1757 xfs_filestream_unmount(mp); in xfs_fs_fill_super()
1759 xfs_freesb(mp); in xfs_fs_fill_super()
1761 xchk_mount_stats_free(mp); in xfs_fs_fill_super()
1763 free_percpu(mp->m_stats.xs_stats); in xfs_fs_fill_super()
1765 xfs_inodegc_free_percpu(mp); in xfs_fs_fill_super()
1767 xfs_destroy_percpu_counters(mp); in xfs_fs_fill_super()
1769 xfs_destroy_mount_workqueues(mp); in xfs_fs_fill_super()
1771 xfs_shutdown_devices(mp); in xfs_fs_fill_super()
1775 xfs_filestream_unmount(mp); in xfs_fs_fill_super()
1776 xfs_unmountfs(mp); in xfs_fs_fill_super()
1789 struct xfs_mount *mp) in xfs_remount_rw() argument
1791 struct xfs_sb *sbp = &mp->m_sb; in xfs_remount_rw()
1794 if (xfs_has_norecovery(mp)) { in xfs_remount_rw()
1795 xfs_warn(mp, in xfs_remount_rw()
1802 xfs_warn(mp, in xfs_remount_rw()
1809 clear_bit(XFS_OPSTATE_READONLY, &mp->m_opstate); in xfs_remount_rw()
1815 if (mp->m_update_sb) { in xfs_remount_rw()
1816 error = xfs_sync_sb(mp, false); in xfs_remount_rw()
1818 xfs_warn(mp, "failed to write sb changes"); in xfs_remount_rw()
1821 mp->m_update_sb = false; in xfs_remount_rw()
1828 xfs_restore_resvblks(mp); in xfs_remount_rw()
1829 xfs_log_work_queue(mp); in xfs_remount_rw()
1830 xfs_blockgc_start(mp); in xfs_remount_rw()
1833 error = xfs_fs_reserve_ag_blocks(mp); in xfs_remount_rw()
1838 xfs_inodegc_start(mp); in xfs_remount_rw()
1845 struct xfs_mount *mp) in xfs_remount_ro() argument
1853 error = sync_filesystem(mp->m_super); in xfs_remount_ro()
1861 xfs_blockgc_stop(mp); in xfs_remount_ro()
1869 error = xfs_blockgc_free_space(mp, &icw); in xfs_remount_ro()
1871 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_remount_ro()
1882 xfs_inodegc_stop(mp); in xfs_remount_ro()
1885 error = xfs_fs_unreserve_ag_blocks(mp); in xfs_remount_ro()
1887 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_remount_ro()
1898 xfs_save_resvblks(mp); in xfs_remount_ro()
1900 xfs_log_clean(mp); in xfs_remount_ro()
1901 set_bit(XFS_OPSTATE_READONLY, &mp->m_opstate); in xfs_remount_ro()
1922 struct xfs_mount *mp = XFS_M(fc->root->d_sb); in xfs_fs_reconfigure() local
1928 if (xfs_has_crc(mp)) in xfs_fs_reconfigure()
1936 if (xfs_has_small_inums(mp) && !xfs_has_small_inums(new_mp)) { in xfs_fs_reconfigure()
1937 mp->m_features &= ~XFS_FEAT_SMALL_INUMS; in xfs_fs_reconfigure()
1938 mp->m_maxagi = xfs_set_inode_alloc(mp, mp->m_sb.sb_agcount); in xfs_fs_reconfigure()
1942 if (!xfs_has_small_inums(mp) && xfs_has_small_inums(new_mp)) { in xfs_fs_reconfigure()
1943 mp->m_features |= XFS_FEAT_SMALL_INUMS; in xfs_fs_reconfigure()
1944 mp->m_maxagi = xfs_set_inode_alloc(mp, mp->m_sb.sb_agcount); in xfs_fs_reconfigure()
1948 if (xfs_is_readonly(mp) && !(flags & SB_RDONLY)) { in xfs_fs_reconfigure()
1949 error = xfs_remount_rw(mp); in xfs_fs_reconfigure()
1955 if (!xfs_is_readonly(mp) && (flags & SB_RDONLY)) { in xfs_fs_reconfigure()
1956 error = xfs_remount_ro(mp); in xfs_fs_reconfigure()
1968 struct xfs_mount *mp = fc->s_fs_info; in xfs_fs_free() local
1976 if (mp) in xfs_fs_free()
1977 xfs_mount_free(mp); in xfs_fs_free()
1995 struct xfs_mount *mp; in xfs_init_fs_context() local
1997 mp = kmem_alloc(sizeof(struct xfs_mount), KM_ZERO); in xfs_init_fs_context()
1998 if (!mp) in xfs_init_fs_context()
2001 spin_lock_init(&mp->m_sb_lock); in xfs_init_fs_context()
2002 INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC); in xfs_init_fs_context()
2003 spin_lock_init(&mp->m_perag_lock); in xfs_init_fs_context()
2004 mutex_init(&mp->m_growlock); in xfs_init_fs_context()
2005 INIT_WORK(&mp->m_flush_inodes_work, xfs_flush_inodes_worker); in xfs_init_fs_context()
2006 INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker); in xfs_init_fs_context()
2007 mp->m_kobj.kobject.kset = xfs_kset; in xfs_init_fs_context()
2014 mp->m_finobt_nores = true; in xfs_init_fs_context()
2019 mp->m_logbufs = -1; in xfs_init_fs_context()
2020 mp->m_logbsize = -1; in xfs_init_fs_context()
2021 mp->m_allocsize_log = 16; /* 64k */ in xfs_init_fs_context()
2023 fc->s_fs_info = mp; in xfs_init_fs_context()