Lines Matching refs:mp

60 static inline void xfs_mount_list_add(struct xfs_mount *mp)  in xfs_mount_list_add()  argument
63 list_add(&mp->m_mount_list, &xfs_mount_list); in xfs_mount_list_add()
67 static inline void xfs_mount_list_del(struct xfs_mount *mp) in xfs_mount_list_del() argument
70 list_del(&mp->m_mount_list); in xfs_mount_list_del()
74 static inline void xfs_mount_list_add(struct xfs_mount *mp) {} in xfs_mount_list_add() argument
75 static inline void xfs_mount_list_del(struct xfs_mount *mp) {} in xfs_mount_list_del() argument
86 struct xfs_mount *mp, in xfs_mount_set_dax_mode() argument
91 mp->m_features &= ~(XFS_FEAT_DAX_ALWAYS | XFS_FEAT_DAX_NEVER); in xfs_mount_set_dax_mode()
94 mp->m_features |= XFS_FEAT_DAX_ALWAYS; in xfs_mount_set_dax_mode()
95 mp->m_features &= ~XFS_FEAT_DAX_NEVER; in xfs_mount_set_dax_mode()
98 mp->m_features |= XFS_FEAT_DAX_NEVER; in xfs_mount_set_dax_mode()
99 mp->m_features &= ~XFS_FEAT_DAX_ALWAYS; in xfs_mount_set_dax_mode()
198 struct xfs_mount *mp = XFS_M(root->d_sb); in xfs_fs_show_options() local
202 if (mp->m_features & xfs_infop->flag) in xfs_fs_show_options()
206 seq_printf(m, ",inode%d", xfs_has_small_inums(mp) ? 32 : 64); in xfs_fs_show_options()
208 if (xfs_has_allocsize(mp)) in xfs_fs_show_options()
210 (1 << mp->m_allocsize_log) >> 10); in xfs_fs_show_options()
212 if (mp->m_logbufs > 0) in xfs_fs_show_options()
213 seq_printf(m, ",logbufs=%d", mp->m_logbufs); in xfs_fs_show_options()
214 if (mp->m_logbsize > 0) in xfs_fs_show_options()
215 seq_printf(m, ",logbsize=%dk", mp->m_logbsize >> 10); in xfs_fs_show_options()
217 if (mp->m_logname) in xfs_fs_show_options()
218 seq_show_option(m, "logdev", mp->m_logname); in xfs_fs_show_options()
219 if (mp->m_rtname) in xfs_fs_show_options()
220 seq_show_option(m, "rtdev", mp->m_rtname); in xfs_fs_show_options()
222 if (mp->m_dalign > 0) in xfs_fs_show_options()
224 (int)XFS_FSB_TO_BB(mp, mp->m_dalign)); in xfs_fs_show_options()
225 if (mp->m_swidth > 0) in xfs_fs_show_options()
227 (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); in xfs_fs_show_options()
229 if (mp->m_qflags & XFS_UQUOTA_ENFD) in xfs_fs_show_options()
231 else if (mp->m_qflags & XFS_UQUOTA_ACCT) in xfs_fs_show_options()
234 if (mp->m_qflags & XFS_PQUOTA_ENFD) in xfs_fs_show_options()
236 else if (mp->m_qflags & XFS_PQUOTA_ACCT) in xfs_fs_show_options()
239 if (mp->m_qflags & XFS_GQUOTA_ENFD) in xfs_fs_show_options()
241 else if (mp->m_qflags & XFS_GQUOTA_ACCT) in xfs_fs_show_options()
244 if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) in xfs_fs_show_options()
293 struct xfs_mount *mp, in xfs_set_inode_alloc() argument
298 xfs_sb_t *sbp = &mp->m_sb; in xfs_set_inode_alloc()
307 if (M_IGEO(mp)->maxicount) { in xfs_set_inode_alloc()
320 agino = XFS_AGB_TO_AGINO(mp, sbp->sb_agblocks - 1); in xfs_set_inode_alloc()
321 ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino); in xfs_set_inode_alloc()
328 if (xfs_has_small_inums(mp) && ino > XFS_MAXINUMBER_32) in xfs_set_inode_alloc()
329 set_bit(XFS_OPSTATE_INODE32, &mp->m_opstate); in xfs_set_inode_alloc()
331 clear_bit(XFS_OPSTATE_INODE32, &mp->m_opstate); in xfs_set_inode_alloc()
336 ino = XFS_AGINO_TO_INO(mp, index, agino); in xfs_set_inode_alloc()
338 pag = xfs_perag_get(mp, index); in xfs_set_inode_alloc()
344 return xfs_is_inode32(mp) ? maxagi : agcount; in xfs_set_inode_alloc()
349 struct xfs_mount *mp) in xfs_setup_dax_always() argument
351 if (!mp->m_ddev_targp->bt_daxdev && in xfs_setup_dax_always()
352 (!mp->m_rtdev_targp || !mp->m_rtdev_targp->bt_daxdev)) { in xfs_setup_dax_always()
353 xfs_alert(mp, in xfs_setup_dax_always()
358 if (mp->m_super->s_blocksize != PAGE_SIZE) { in xfs_setup_dax_always()
359 xfs_alert(mp, in xfs_setup_dax_always()
364 if (xfs_has_reflink(mp) && in xfs_setup_dax_always()
365 bdev_is_partition(mp->m_ddev_targp->bt_bdev)) { in xfs_setup_dax_always()
366 xfs_alert(mp, in xfs_setup_dax_always()
371 xfs_warn(mp, "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); in xfs_setup_dax_always()
375 xfs_mount_set_dax_mode(mp, XFS_DAX_NEVER); in xfs_setup_dax_always()
381 xfs_mount_t *mp, in xfs_blkdev_get() argument
388 mp); in xfs_blkdev_get()
391 xfs_warn(mp, "Invalid device [%s], error=%d", name, error); in xfs_blkdev_get()
407 struct xfs_mount *mp) in xfs_close_devices() argument
409 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { in xfs_close_devices()
410 struct block_device *logdev = mp->m_logdev_targp->bt_bdev; in xfs_close_devices()
412 xfs_free_buftarg(mp->m_logdev_targp); in xfs_close_devices()
415 if (mp->m_rtdev_targp) { in xfs_close_devices()
416 struct block_device *rtdev = mp->m_rtdev_targp->bt_bdev; in xfs_close_devices()
418 xfs_free_buftarg(mp->m_rtdev_targp); in xfs_close_devices()
421 xfs_free_buftarg(mp->m_ddev_targp); in xfs_close_devices()
436 struct xfs_mount *mp) in xfs_open_devices() argument
438 struct block_device *ddev = mp->m_super->s_bdev; in xfs_open_devices()
445 if (mp->m_logname) { in xfs_open_devices()
446 error = xfs_blkdev_get(mp, mp->m_logname, &logdev); in xfs_open_devices()
451 if (mp->m_rtname) { in xfs_open_devices()
452 error = xfs_blkdev_get(mp, mp->m_rtname, &rtdev); in xfs_open_devices()
457 xfs_warn(mp, in xfs_open_devices()
468 mp->m_ddev_targp = xfs_alloc_buftarg(mp, ddev); in xfs_open_devices()
469 if (!mp->m_ddev_targp) in xfs_open_devices()
473 mp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev); in xfs_open_devices()
474 if (!mp->m_rtdev_targp) in xfs_open_devices()
479 mp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev); in xfs_open_devices()
480 if (!mp->m_logdev_targp) in xfs_open_devices()
483 mp->m_logdev_targp = mp->m_ddev_targp; in xfs_open_devices()
489 if (mp->m_rtdev_targp) in xfs_open_devices()
490 xfs_free_buftarg(mp->m_rtdev_targp); in xfs_open_devices()
492 xfs_free_buftarg(mp->m_ddev_targp); in xfs_open_devices()
506 struct xfs_mount *mp) in xfs_setup_devices() argument
510 error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_sectsize); in xfs_setup_devices()
514 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { in xfs_setup_devices()
517 if (xfs_has_sector(mp)) in xfs_setup_devices()
518 log_sector_size = mp->m_sb.sb_logsectsize; in xfs_setup_devices()
519 error = xfs_setsize_buftarg(mp->m_logdev_targp, in xfs_setup_devices()
524 if (mp->m_rtdev_targp) { in xfs_setup_devices()
525 error = xfs_setsize_buftarg(mp->m_rtdev_targp, in xfs_setup_devices()
526 mp->m_sb.sb_sectsize); in xfs_setup_devices()
536 struct xfs_mount *mp) in xfs_init_mount_workqueues() argument
538 mp->m_buf_workqueue = alloc_workqueue("xfs-buf/%s", in xfs_init_mount_workqueues()
540 1, mp->m_super->s_id); in xfs_init_mount_workqueues()
541 if (!mp->m_buf_workqueue) in xfs_init_mount_workqueues()
544 mp->m_unwritten_workqueue = alloc_workqueue("xfs-conv/%s", in xfs_init_mount_workqueues()
546 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
547 if (!mp->m_unwritten_workqueue) in xfs_init_mount_workqueues()
550 mp->m_reclaim_workqueue = alloc_workqueue("xfs-reclaim/%s", in xfs_init_mount_workqueues()
552 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
553 if (!mp->m_reclaim_workqueue) in xfs_init_mount_workqueues()
556 mp->m_blockgc_wq = alloc_workqueue("xfs-blockgc/%s", in xfs_init_mount_workqueues()
558 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
559 if (!mp->m_blockgc_wq) in xfs_init_mount_workqueues()
562 mp->m_inodegc_wq = alloc_workqueue("xfs-inodegc/%s", in xfs_init_mount_workqueues()
564 1, mp->m_super->s_id); in xfs_init_mount_workqueues()
565 if (!mp->m_inodegc_wq) in xfs_init_mount_workqueues()
568 mp->m_sync_workqueue = alloc_workqueue("xfs-sync/%s", in xfs_init_mount_workqueues()
569 XFS_WQFLAGS(WQ_FREEZABLE), 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
570 if (!mp->m_sync_workqueue) in xfs_init_mount_workqueues()
576 destroy_workqueue(mp->m_inodegc_wq); in xfs_init_mount_workqueues()
578 destroy_workqueue(mp->m_blockgc_wq); in xfs_init_mount_workqueues()
580 destroy_workqueue(mp->m_reclaim_workqueue); in xfs_init_mount_workqueues()
582 destroy_workqueue(mp->m_unwritten_workqueue); in xfs_init_mount_workqueues()
584 destroy_workqueue(mp->m_buf_workqueue); in xfs_init_mount_workqueues()
591 struct xfs_mount *mp) in xfs_destroy_mount_workqueues() argument
593 destroy_workqueue(mp->m_sync_workqueue); in xfs_destroy_mount_workqueues()
594 destroy_workqueue(mp->m_blockgc_wq); in xfs_destroy_mount_workqueues()
595 destroy_workqueue(mp->m_inodegc_wq); in xfs_destroy_mount_workqueues()
596 destroy_workqueue(mp->m_reclaim_workqueue); in xfs_destroy_mount_workqueues()
597 destroy_workqueue(mp->m_unwritten_workqueue); in xfs_destroy_mount_workqueues()
598 destroy_workqueue(mp->m_buf_workqueue); in xfs_destroy_mount_workqueues()
605 struct xfs_mount *mp = container_of(work, struct xfs_mount, in xfs_flush_inodes_worker() local
607 struct super_block *sb = mp->m_super; in xfs_flush_inodes_worker()
623 struct xfs_mount *mp) in xfs_flush_inodes() argument
629 if (flush_work(&mp->m_flush_inodes_work)) in xfs_flush_inodes()
632 queue_work(mp->m_sync_workqueue, &mp->m_flush_inodes_work); in xfs_flush_inodes()
633 flush_work(&mp->m_flush_inodes_work); in xfs_flush_inodes()
669 struct xfs_mount *mp = ip->i_mount; in xfs_fs_dirty_inode() local
683 if (xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp)) in xfs_fs_dirty_inode()
746 struct xfs_mount *mp) in xfs_mount_free() argument
748 kfree(mp->m_rtname); in xfs_mount_free()
749 kfree(mp->m_logname); in xfs_mount_free()
750 kmem_free(mp); in xfs_mount_free()
758 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_sync_fs() local
761 trace_xfs_fs_sync_fs(mp, __return_address); in xfs_fs_sync_fs()
769 error = xfs_log_force(mp, XFS_LOG_SYNC); in xfs_fs_sync_fs()
779 flush_delayed_work(&mp->m_log->l_work); in xfs_fs_sync_fs()
797 xfs_inodegc_stop(mp); in xfs_fs_sync_fs()
798 xfs_blockgc_stop(mp); in xfs_fs_sync_fs()
809 struct xfs_mount *mp = XFS_M(dentry->d_sb); in xfs_fs_statfs() local
810 xfs_sb_t *sbp = &mp->m_sb; in xfs_fs_statfs()
823 xfs_inodegc_push(mp); in xfs_fs_statfs()
828 id = huge_encode_dev(mp->m_ddev_targp->bt_dev); in xfs_fs_statfs()
831 icount = percpu_counter_sum(&mp->m_icount); in xfs_fs_statfs()
832 ifree = percpu_counter_sum(&mp->m_ifree); in xfs_fs_statfs()
833 fdblocks = percpu_counter_sum(&mp->m_fdblocks); in xfs_fs_statfs()
835 spin_lock(&mp->m_sb_lock); in xfs_fs_statfs()
839 spin_unlock(&mp->m_sb_lock); in xfs_fs_statfs()
843 fdblocks - xfs_fdblocks_unavailable(mp)); in xfs_fs_statfs()
846 fakeinos = XFS_FSB_TO_INO(mp, statp->f_bfree); in xfs_fs_statfs()
848 if (M_IGEO(mp)->maxicount) in xfs_fs_statfs()
851 M_IGEO(mp)->maxicount); in xfs_fs_statfs()
864 ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD))) == in xfs_fs_statfs()
868 if (XFS_IS_REALTIME_MOUNT(mp) && in xfs_fs_statfs()
873 freertx = percpu_counter_sum_positive(&mp->m_frextents); in xfs_fs_statfs()
881 xfs_save_resvblks(struct xfs_mount *mp) in xfs_save_resvblks() argument
885 mp->m_resblks_save = mp->m_resblks; in xfs_save_resvblks()
886 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_save_resvblks()
890 xfs_restore_resvblks(struct xfs_mount *mp) in xfs_restore_resvblks() argument
894 if (mp->m_resblks_save) { in xfs_restore_resvblks()
895 resblks = mp->m_resblks_save; in xfs_restore_resvblks()
896 mp->m_resblks_save = 0; in xfs_restore_resvblks()
898 resblks = xfs_default_resblks(mp); in xfs_restore_resvblks()
900 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_restore_resvblks()
913 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_freeze() local
923 xfs_save_resvblks(mp); in xfs_fs_freeze()
924 ret = xfs_log_quiesce(mp); in xfs_fs_freeze()
934 if (ret && !xfs_is_readonly(mp)) { in xfs_fs_freeze()
935 xfs_blockgc_start(mp); in xfs_fs_freeze()
936 xfs_inodegc_start(mp); in xfs_fs_freeze()
946 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_unfreeze() local
948 xfs_restore_resvblks(mp); in xfs_fs_unfreeze()
949 xfs_log_work_queue(mp); in xfs_fs_unfreeze()
957 if (!xfs_is_readonly(mp)) { in xfs_fs_unfreeze()
958 xfs_blockgc_start(mp); in xfs_fs_unfreeze()
959 xfs_inodegc_start(mp); in xfs_fs_unfreeze()
971 struct xfs_mount *mp) in xfs_finish_flags() argument
974 if (xfs_has_logv2(mp)) { in xfs_finish_flags()
975 if (mp->m_logbsize <= 0 && in xfs_finish_flags()
976 mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
977 mp->m_logbsize = mp->m_sb.sb_logsunit; in xfs_finish_flags()
978 } else if (mp->m_logbsize > 0 && in xfs_finish_flags()
979 mp->m_logbsize < mp->m_sb.sb_logsunit) { in xfs_finish_flags()
980 xfs_warn(mp, in xfs_finish_flags()
986 if (mp->m_logbsize > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
987 xfs_warn(mp, in xfs_finish_flags()
996 if (xfs_has_crc(mp) && xfs_has_noattr2(mp)) { in xfs_finish_flags()
997 xfs_warn(mp, "Cannot mount a V5 filesystem as noattr2. " in xfs_finish_flags()
1005 if ((mp->m_sb.sb_flags & XFS_SBF_READONLY) && !xfs_is_readonly(mp)) { in xfs_finish_flags()
1006 xfs_warn(mp, in xfs_finish_flags()
1011 if ((mp->m_qflags & XFS_GQUOTA_ACCT) && in xfs_finish_flags()
1012 (mp->m_qflags & XFS_PQUOTA_ACCT) && in xfs_finish_flags()
1013 !xfs_has_pquotino(mp)) { in xfs_finish_flags()
1014 xfs_warn(mp, in xfs_finish_flags()
1024 struct xfs_mount *mp) in xfs_init_percpu_counters() argument
1028 error = percpu_counter_init(&mp->m_icount, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1032 error = percpu_counter_init(&mp->m_ifree, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1036 error = percpu_counter_init(&mp->m_fdblocks, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1040 error = percpu_counter_init(&mp->m_delalloc_blks, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1044 error = percpu_counter_init(&mp->m_frextents, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1051 percpu_counter_destroy(&mp->m_delalloc_blks); in xfs_init_percpu_counters()
1053 percpu_counter_destroy(&mp->m_fdblocks); in xfs_init_percpu_counters()
1055 percpu_counter_destroy(&mp->m_ifree); in xfs_init_percpu_counters()
1057 percpu_counter_destroy(&mp->m_icount); in xfs_init_percpu_counters()
1063 struct xfs_mount *mp) in xfs_reinit_percpu_counters() argument
1065 percpu_counter_set(&mp->m_icount, mp->m_sb.sb_icount); in xfs_reinit_percpu_counters()
1066 percpu_counter_set(&mp->m_ifree, mp->m_sb.sb_ifree); in xfs_reinit_percpu_counters()
1067 percpu_counter_set(&mp->m_fdblocks, mp->m_sb.sb_fdblocks); in xfs_reinit_percpu_counters()
1068 percpu_counter_set(&mp->m_frextents, mp->m_sb.sb_frextents); in xfs_reinit_percpu_counters()
1073 struct xfs_mount *mp) in xfs_destroy_percpu_counters() argument
1075 percpu_counter_destroy(&mp->m_icount); in xfs_destroy_percpu_counters()
1076 percpu_counter_destroy(&mp->m_ifree); in xfs_destroy_percpu_counters()
1077 percpu_counter_destroy(&mp->m_fdblocks); in xfs_destroy_percpu_counters()
1078 ASSERT(xfs_is_shutdown(mp) || in xfs_destroy_percpu_counters()
1079 percpu_counter_sum(&mp->m_delalloc_blks) == 0); in xfs_destroy_percpu_counters()
1080 percpu_counter_destroy(&mp->m_delalloc_blks); in xfs_destroy_percpu_counters()
1081 percpu_counter_destroy(&mp->m_frextents); in xfs_destroy_percpu_counters()
1086 struct xfs_mount *mp) in xfs_inodegc_init_percpu() argument
1091 mp->m_inodegc = alloc_percpu(struct xfs_inodegc); in xfs_inodegc_init_percpu()
1092 if (!mp->m_inodegc) in xfs_inodegc_init_percpu()
1096 gc = per_cpu_ptr(mp->m_inodegc, cpu); in xfs_inodegc_init_percpu()
1106 struct xfs_mount *mp) in xfs_inodegc_free_percpu() argument
1108 if (!mp->m_inodegc) in xfs_inodegc_free_percpu()
1110 free_percpu(mp->m_inodegc); in xfs_inodegc_free_percpu()
1117 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_put_super() local
1123 xfs_notice(mp, "Unmounting Filesystem %pU", &mp->m_sb.sb_uuid); in xfs_fs_put_super()
1124 xfs_filestream_unmount(mp); in xfs_fs_put_super()
1125 xfs_unmountfs(mp); in xfs_fs_put_super()
1127 xfs_freesb(mp); in xfs_fs_put_super()
1128 free_percpu(mp->m_stats.xs_stats); in xfs_fs_put_super()
1129 xfs_mount_list_del(mp); in xfs_fs_put_super()
1130 xfs_inodegc_free_percpu(mp); in xfs_fs_put_super()
1131 xfs_destroy_percpu_counters(mp); in xfs_fs_put_super()
1132 xfs_destroy_mount_workqueues(mp); in xfs_fs_put_super()
1133 xfs_close_devices(mp); in xfs_fs_put_super()
1136 xfs_mount_free(mp); in xfs_fs_put_super()
1384 struct xfs_mount *mp) in xfs_fs_validate_params() argument
1387 if (xfs_has_norecovery(mp) && !xfs_is_readonly(mp)) { in xfs_fs_validate_params()
1388 xfs_warn(mp, "no-recovery mounts must be read-only."); in xfs_fs_validate_params()
1396 if (xfs_has_attr2(mp) && xfs_has_noattr2(mp)) { in xfs_fs_validate_params()
1397 xfs_warn(mp, "attr2 and noattr2 cannot both be specified."); in xfs_fs_validate_params()
1402 if (xfs_has_noalign(mp) && (mp->m_dalign || mp->m_swidth)) { in xfs_fs_validate_params()
1403 xfs_warn(mp, in xfs_fs_validate_params()
1408 if (!IS_ENABLED(CONFIG_XFS_QUOTA) && mp->m_qflags != 0) { in xfs_fs_validate_params()
1409 xfs_warn(mp, "quota support not available in this kernel."); in xfs_fs_validate_params()
1413 if ((mp->m_dalign && !mp->m_swidth) || in xfs_fs_validate_params()
1414 (!mp->m_dalign && mp->m_swidth)) { in xfs_fs_validate_params()
1415 xfs_warn(mp, "sunit and swidth must be specified together"); in xfs_fs_validate_params()
1419 if (mp->m_dalign && (mp->m_swidth % mp->m_dalign != 0)) { in xfs_fs_validate_params()
1420 xfs_warn(mp, in xfs_fs_validate_params()
1422 mp->m_swidth, mp->m_dalign); in xfs_fs_validate_params()
1426 if (mp->m_logbufs != -1 && in xfs_fs_validate_params()
1427 mp->m_logbufs != 0 && in xfs_fs_validate_params()
1428 (mp->m_logbufs < XLOG_MIN_ICLOGS || in xfs_fs_validate_params()
1429 mp->m_logbufs > XLOG_MAX_ICLOGS)) { in xfs_fs_validate_params()
1430 xfs_warn(mp, "invalid logbufs value: %d [not %d-%d]", in xfs_fs_validate_params()
1431 mp->m_logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS); in xfs_fs_validate_params()
1435 if (mp->m_logbsize != -1 && in xfs_fs_validate_params()
1436 mp->m_logbsize != 0 && in xfs_fs_validate_params()
1437 (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE || in xfs_fs_validate_params()
1438 mp->m_logbsize > XLOG_MAX_RECORD_BSIZE || in xfs_fs_validate_params()
1439 !is_power_of_2(mp->m_logbsize))) { in xfs_fs_validate_params()
1440 xfs_warn(mp, in xfs_fs_validate_params()
1442 mp->m_logbsize); in xfs_fs_validate_params()
1446 if (xfs_has_allocsize(mp) && in xfs_fs_validate_params()
1447 (mp->m_allocsize_log > XFS_MAX_IO_LOG || in xfs_fs_validate_params()
1448 mp->m_allocsize_log < XFS_MIN_IO_LOG)) { in xfs_fs_validate_params()
1449 xfs_warn(mp, "invalid log iosize: %d [not %d-%d]", in xfs_fs_validate_params()
1450 mp->m_allocsize_log, XFS_MIN_IO_LOG, XFS_MAX_IO_LOG); in xfs_fs_validate_params()
1462 struct xfs_mount *mp = sb->s_fs_info; in xfs_fs_fill_super() local
1466 mp->m_super = sb; in xfs_fs_fill_super()
1468 error = xfs_fs_validate_params(mp); in xfs_fs_fill_super()
1487 xfs_notice(mp, "Delaying mount for %d seconds.", in xfs_fs_fill_super()
1495 error = xfs_open_devices(mp); in xfs_fs_fill_super()
1499 error = xfs_init_mount_workqueues(mp); in xfs_fs_fill_super()
1503 error = xfs_init_percpu_counters(mp); in xfs_fs_fill_super()
1507 error = xfs_inodegc_init_percpu(mp); in xfs_fs_fill_super()
1516 xfs_mount_list_add(mp); in xfs_fs_fill_super()
1519 mp->m_stats.xs_stats = alloc_percpu(struct xfsstats); in xfs_fs_fill_super()
1520 if (!mp->m_stats.xs_stats) { in xfs_fs_fill_super()
1525 error = xfs_readsb(mp, flags); in xfs_fs_fill_super()
1529 error = xfs_finish_flags(mp); in xfs_fs_fill_super()
1533 error = xfs_setup_devices(mp); in xfs_fs_fill_super()
1538 if (!xfs_has_crc(mp)) { in xfs_fs_fill_super()
1540 xfs_warn_once(mp, in xfs_fs_fill_super()
1543 xfs_warn(mp, in xfs_fs_fill_super()
1551 if (xfs_has_needsrepair(mp)) { in xfs_fs_fill_super()
1552 xfs_warn(mp, "Filesystem needs repair. Please run xfs_repair."); in xfs_fs_fill_super()
1562 if (mp->m_sb.sb_inprogress) { in xfs_fs_fill_super()
1563 xfs_warn(mp, "Offline file system operation in progress!"); in xfs_fs_fill_super()
1571 if (mp->m_sb.sb_blocksize > PAGE_SIZE) { in xfs_fs_fill_super()
1572 xfs_warn(mp, in xfs_fs_fill_super()
1575 mp->m_sb.sb_blocksize, PAGE_SIZE); in xfs_fs_fill_super()
1581 if (xfs_sb_validate_fsb_count(&mp->m_sb, mp->m_sb.sb_dblocks) || in xfs_fs_fill_super()
1582 xfs_sb_validate_fsb_count(&mp->m_sb, mp->m_sb.sb_rblocks)) { in xfs_fs_fill_super()
1583 xfs_warn(mp, in xfs_fs_fill_super()
1600 if (!xfs_verify_fileoff(mp, XFS_B_TO_FSBT(mp, MAX_LFS_FILESIZE))) { in xfs_fs_fill_super()
1601 xfs_warn(mp, in xfs_fs_fill_super()
1603 XFS_B_TO_FSBT(mp, MAX_LFS_FILESIZE), in xfs_fs_fill_super()
1609 error = xfs_filestream_mount(mp); in xfs_fs_fill_super()
1618 sb->s_blocksize = mp->m_sb.sb_blocksize; in xfs_fs_fill_super()
1623 if (xfs_has_bigtime(mp)) { in xfs_fs_fill_super()
1630 trace_xfs_inode_timestamp_range(mp, sb->s_time_min, sb->s_time_max); in xfs_fs_fill_super()
1636 if (xfs_has_crc(mp)) in xfs_fs_fill_super()
1639 if (xfs_has_dax_always(mp)) { in xfs_fs_fill_super()
1640 error = xfs_setup_dax_always(mp); in xfs_fs_fill_super()
1645 if (xfs_has_discard(mp) && !bdev_max_discard_sectors(sb->s_bdev)) { in xfs_fs_fill_super()
1646 xfs_warn(mp, in xfs_fs_fill_super()
1648 mp->m_features &= ~XFS_FEAT_DISCARD; in xfs_fs_fill_super()
1651 if (xfs_has_reflink(mp)) { in xfs_fs_fill_super()
1652 if (mp->m_sb.sb_rblocks) { in xfs_fs_fill_super()
1653 xfs_alert(mp, in xfs_fs_fill_super()
1660 xfs_info(mp, "using DEBUG-only always_cow mode."); in xfs_fs_fill_super()
1661 mp->m_always_cow = true; in xfs_fs_fill_super()
1665 if (xfs_has_rmapbt(mp) && mp->m_sb.sb_rblocks) { in xfs_fs_fill_super()
1666 xfs_alert(mp, in xfs_fs_fill_super()
1672 if (xfs_has_large_extent_counts(mp)) in xfs_fs_fill_super()
1673 xfs_warn(mp, in xfs_fs_fill_super()
1676 error = xfs_mountfs(mp); in xfs_fs_fill_super()
1680 root = igrab(VFS_I(mp->m_rootip)); in xfs_fs_fill_super()
1694 xfs_filestream_unmount(mp); in xfs_fs_fill_super()
1696 xfs_freesb(mp); in xfs_fs_fill_super()
1698 free_percpu(mp->m_stats.xs_stats); in xfs_fs_fill_super()
1700 xfs_mount_list_del(mp); in xfs_fs_fill_super()
1701 xfs_inodegc_free_percpu(mp); in xfs_fs_fill_super()
1703 xfs_destroy_percpu_counters(mp); in xfs_fs_fill_super()
1705 xfs_destroy_mount_workqueues(mp); in xfs_fs_fill_super()
1707 xfs_close_devices(mp); in xfs_fs_fill_super()
1710 xfs_mount_free(mp); in xfs_fs_fill_super()
1714 xfs_filestream_unmount(mp); in xfs_fs_fill_super()
1715 xfs_unmountfs(mp); in xfs_fs_fill_super()
1728 struct xfs_mount *mp) in xfs_remount_rw() argument
1730 struct xfs_sb *sbp = &mp->m_sb; in xfs_remount_rw()
1733 if (xfs_has_norecovery(mp)) { in xfs_remount_rw()
1734 xfs_warn(mp, in xfs_remount_rw()
1741 xfs_warn(mp, in xfs_remount_rw()
1748 clear_bit(XFS_OPSTATE_READONLY, &mp->m_opstate); in xfs_remount_rw()
1754 if (mp->m_update_sb) { in xfs_remount_rw()
1755 error = xfs_sync_sb(mp, false); in xfs_remount_rw()
1757 xfs_warn(mp, "failed to write sb changes"); in xfs_remount_rw()
1760 mp->m_update_sb = false; in xfs_remount_rw()
1767 xfs_restore_resvblks(mp); in xfs_remount_rw()
1768 xfs_log_work_queue(mp); in xfs_remount_rw()
1769 xfs_blockgc_start(mp); in xfs_remount_rw()
1772 error = xfs_fs_reserve_ag_blocks(mp); in xfs_remount_rw()
1777 xfs_inodegc_start(mp); in xfs_remount_rw()
1784 struct xfs_mount *mp) in xfs_remount_ro() argument
1792 error = sync_filesystem(mp->m_super); in xfs_remount_ro()
1800 xfs_blockgc_stop(mp); in xfs_remount_ro()
1808 error = xfs_blockgc_free_space(mp, &icw); in xfs_remount_ro()
1810 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_remount_ro()
1821 xfs_inodegc_stop(mp); in xfs_remount_ro()
1824 error = xfs_fs_unreserve_ag_blocks(mp); in xfs_remount_ro()
1826 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_remount_ro()
1837 xfs_save_resvblks(mp); in xfs_remount_ro()
1839 xfs_log_clean(mp); in xfs_remount_ro()
1840 set_bit(XFS_OPSTATE_READONLY, &mp->m_opstate); in xfs_remount_ro()
1861 struct xfs_mount *mp = XFS_M(fc->root->d_sb); in xfs_fs_reconfigure() local
1867 if (xfs_has_crc(mp)) in xfs_fs_reconfigure()
1875 if (xfs_has_small_inums(mp) && !xfs_has_small_inums(new_mp)) { in xfs_fs_reconfigure()
1876 mp->m_features &= ~XFS_FEAT_SMALL_INUMS; in xfs_fs_reconfigure()
1877 mp->m_maxagi = xfs_set_inode_alloc(mp, mp->m_sb.sb_agcount); in xfs_fs_reconfigure()
1881 if (!xfs_has_small_inums(mp) && xfs_has_small_inums(new_mp)) { in xfs_fs_reconfigure()
1882 mp->m_features |= XFS_FEAT_SMALL_INUMS; in xfs_fs_reconfigure()
1883 mp->m_maxagi = xfs_set_inode_alloc(mp, mp->m_sb.sb_agcount); in xfs_fs_reconfigure()
1887 if (xfs_is_readonly(mp) && !(flags & SB_RDONLY)) { in xfs_fs_reconfigure()
1888 error = xfs_remount_rw(mp); in xfs_fs_reconfigure()
1894 if (!xfs_is_readonly(mp) && (flags & SB_RDONLY)) { in xfs_fs_reconfigure()
1895 error = xfs_remount_ro(mp); in xfs_fs_reconfigure()
1906 struct xfs_mount *mp = fc->s_fs_info; in xfs_fs_free() local
1914 if (mp) in xfs_fs_free()
1915 xfs_mount_free(mp); in xfs_fs_free()
1928 struct xfs_mount *mp; in xfs_init_fs_context() local
1930 mp = kmem_alloc(sizeof(struct xfs_mount), KM_ZERO); in xfs_init_fs_context()
1931 if (!mp) in xfs_init_fs_context()
1934 spin_lock_init(&mp->m_sb_lock); in xfs_init_fs_context()
1935 INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC); in xfs_init_fs_context()
1936 spin_lock_init(&mp->m_perag_lock); in xfs_init_fs_context()
1937 mutex_init(&mp->m_growlock); in xfs_init_fs_context()
1938 INIT_WORK(&mp->m_flush_inodes_work, xfs_flush_inodes_worker); in xfs_init_fs_context()
1939 INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker); in xfs_init_fs_context()
1940 mp->m_kobj.kobject.kset = xfs_kset; in xfs_init_fs_context()
1947 mp->m_finobt_nores = true; in xfs_init_fs_context()
1952 mp->m_logbufs = -1; in xfs_init_fs_context()
1953 mp->m_logbsize = -1; in xfs_init_fs_context()
1954 mp->m_allocsize_log = 16; /* 64k */ in xfs_init_fs_context()
1960 set_bit(XFS_OPSTATE_READONLY, &mp->m_opstate); in xfs_init_fs_context()
1962 mp->m_features |= XFS_FEAT_DIRSYNC; in xfs_init_fs_context()
1964 mp->m_features |= XFS_FEAT_WSYNC; in xfs_init_fs_context()
1966 fc->s_fs_info = mp; in xfs_init_fs_context()
2244 struct xfs_mount *mp, *n; in xfs_cpu_dead() local
2247 list_for_each_entry_safe(mp, n, &xfs_mount_list, m_mount_list) { in xfs_cpu_dead()
2249 xfs_inodegc_cpu_dead(mp, cpu); in xfs_cpu_dead()
2250 xlog_cil_pcp_dead(mp->m_log, cpu); in xfs_cpu_dead()