• Home
  • Raw
  • Download

Lines Matching full: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()
267 * because in the growfs case, mp->m_sb.sb_agcount is not yet updated
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()
881 if (XFS_IS_REALTIME_MOUNT(mp) && in xfs_fs_statfs()
886 freertx = percpu_counter_sum_positive(&mp->m_frextents); in xfs_fs_statfs()
891 ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD))) == in xfs_fs_statfs()
899 xfs_save_resvblks(struct xfs_mount *mp) in xfs_save_resvblks() argument
903 mp->m_resblks_save = mp->m_resblks; in xfs_save_resvblks()
904 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_save_resvblks()
908 xfs_restore_resvblks(struct xfs_mount *mp) in xfs_restore_resvblks() argument
912 if (mp->m_resblks_save) { in xfs_restore_resvblks()
913 resblks = mp->m_resblks_save; in xfs_restore_resvblks()
914 mp->m_resblks_save = 0; in xfs_restore_resvblks()
916 resblks = xfs_default_resblks(mp); in xfs_restore_resvblks()
918 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_restore_resvblks()
931 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_freeze() local
941 xfs_save_resvblks(mp); in xfs_fs_freeze()
942 ret = xfs_log_quiesce(mp); in xfs_fs_freeze()
952 if (ret && !xfs_is_readonly(mp)) { in xfs_fs_freeze()
953 xfs_blockgc_start(mp); in xfs_fs_freeze()
954 xfs_inodegc_start(mp); in xfs_fs_freeze()
964 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_unfreeze() local
966 xfs_restore_resvblks(mp); in xfs_fs_unfreeze()
967 xfs_log_work_queue(mp); in xfs_fs_unfreeze()
975 if (!xfs_is_readonly(mp)) { in xfs_fs_unfreeze()
976 xfs_blockgc_start(mp); in xfs_fs_unfreeze()
977 xfs_inodegc_start(mp); in xfs_fs_unfreeze()
989 struct xfs_mount *mp) in xfs_finish_flags() argument
992 if (xfs_has_logv2(mp)) { in xfs_finish_flags()
993 if (mp->m_logbsize <= 0 && in xfs_finish_flags()
994 mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
995 mp->m_logbsize = mp->m_sb.sb_logsunit; in xfs_finish_flags()
996 } else if (mp->m_logbsize > 0 && in xfs_finish_flags()
997 mp->m_logbsize < mp->m_sb.sb_logsunit) { in xfs_finish_flags()
998 xfs_warn(mp, in xfs_finish_flags()
1004 if (mp->m_logbsize > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
1005 xfs_warn(mp, in xfs_finish_flags()
1014 if (xfs_has_crc(mp) && xfs_has_noattr2(mp)) { in xfs_finish_flags()
1015 xfs_warn(mp, "Cannot mount a V5 filesystem as noattr2. " in xfs_finish_flags()
1023 if ((mp->m_sb.sb_flags & XFS_SBF_READONLY) && !xfs_is_readonly(mp)) { in xfs_finish_flags()
1024 xfs_warn(mp, in xfs_finish_flags()
1029 if ((mp->m_qflags & XFS_GQUOTA_ACCT) && in xfs_finish_flags()
1030 (mp->m_qflags & XFS_PQUOTA_ACCT) && in xfs_finish_flags()
1031 !xfs_has_pquotino(mp)) { in xfs_finish_flags()
1032 xfs_warn(mp, in xfs_finish_flags()
1042 struct xfs_mount *mp) in xfs_init_percpu_counters() argument
1046 error = percpu_counter_init(&mp->m_icount, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1050 error = percpu_counter_init(&mp->m_ifree, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1054 error = percpu_counter_init(&mp->m_fdblocks, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1058 error = percpu_counter_init(&mp->m_delalloc_blks, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1062 error = percpu_counter_init(&mp->m_frextents, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1069 percpu_counter_destroy(&mp->m_delalloc_blks); in xfs_init_percpu_counters()
1071 percpu_counter_destroy(&mp->m_fdblocks); in xfs_init_percpu_counters()
1073 percpu_counter_destroy(&mp->m_ifree); in xfs_init_percpu_counters()
1075 percpu_counter_destroy(&mp->m_icount); in xfs_init_percpu_counters()
1081 struct xfs_mount *mp) in xfs_reinit_percpu_counters() argument
1083 percpu_counter_set(&mp->m_icount, mp->m_sb.sb_icount); in xfs_reinit_percpu_counters()
1084 percpu_counter_set(&mp->m_ifree, mp->m_sb.sb_ifree); in xfs_reinit_percpu_counters()
1085 percpu_counter_set(&mp->m_fdblocks, mp->m_sb.sb_fdblocks); in xfs_reinit_percpu_counters()
1086 percpu_counter_set(&mp->m_frextents, mp->m_sb.sb_frextents); in xfs_reinit_percpu_counters()
1091 struct xfs_mount *mp) in xfs_destroy_percpu_counters() argument
1093 percpu_counter_destroy(&mp->m_icount); in xfs_destroy_percpu_counters()
1094 percpu_counter_destroy(&mp->m_ifree); in xfs_destroy_percpu_counters()
1095 percpu_counter_destroy(&mp->m_fdblocks); in xfs_destroy_percpu_counters()
1096 ASSERT(xfs_is_shutdown(mp) || in xfs_destroy_percpu_counters()
1097 percpu_counter_sum(&mp->m_delalloc_blks) == 0); in xfs_destroy_percpu_counters()
1098 percpu_counter_destroy(&mp->m_delalloc_blks); in xfs_destroy_percpu_counters()
1099 percpu_counter_destroy(&mp->m_frextents); in xfs_destroy_percpu_counters()
1104 struct xfs_mount *mp) in xfs_inodegc_init_percpu() argument
1109 mp->m_inodegc = alloc_percpu(struct xfs_inodegc); in xfs_inodegc_init_percpu()
1110 if (!mp->m_inodegc) in xfs_inodegc_init_percpu()
1114 gc = per_cpu_ptr(mp->m_inodegc, cpu); in xfs_inodegc_init_percpu()
1116 gc->mp = mp; in xfs_inodegc_init_percpu()
1127 struct xfs_mount *mp) in xfs_inodegc_free_percpu() argument
1129 if (!mp->m_inodegc) in xfs_inodegc_free_percpu()
1131 free_percpu(mp->m_inodegc); in xfs_inodegc_free_percpu()
1138 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_put_super() local
1140 xfs_notice(mp, "Unmounting Filesystem %pU", &mp->m_sb.sb_uuid); in xfs_fs_put_super()
1141 xfs_filestream_unmount(mp); in xfs_fs_put_super()
1142 xfs_unmountfs(mp); in xfs_fs_put_super()
1144 xfs_freesb(mp); in xfs_fs_put_super()
1145 xchk_mount_stats_free(mp); in xfs_fs_put_super()
1146 free_percpu(mp->m_stats.xs_stats); in xfs_fs_put_super()
1147 xfs_inodegc_free_percpu(mp); in xfs_fs_put_super()
1148 xfs_destroy_percpu_counters(mp); in xfs_fs_put_super()
1149 xfs_destroy_mount_workqueues(mp); in xfs_fs_put_super()
1150 xfs_shutdown_devices(mp); in xfs_fs_put_super()
1249 * NOTE: mp->m_super is NULL here!
1406 struct xfs_mount *mp) in xfs_fs_validate_params() argument
1409 if (xfs_has_norecovery(mp) && !xfs_is_readonly(mp)) { in xfs_fs_validate_params()
1410 xfs_warn(mp, "no-recovery mounts must be read-only."); in xfs_fs_validate_params()
1418 if (xfs_has_attr2(mp) && xfs_has_noattr2(mp)) { in xfs_fs_validate_params()
1419 xfs_warn(mp, "attr2 and noattr2 cannot both be specified."); in xfs_fs_validate_params()
1424 if (xfs_has_noalign(mp) && (mp->m_dalign || mp->m_swidth)) { in xfs_fs_validate_params()
1425 xfs_warn(mp, in xfs_fs_validate_params()
1430 if (!IS_ENABLED(CONFIG_XFS_QUOTA) && mp->m_qflags != 0) { in xfs_fs_validate_params()
1431 xfs_warn(mp, "quota support not available in this kernel."); in xfs_fs_validate_params()
1435 if ((mp->m_dalign && !mp->m_swidth) || in xfs_fs_validate_params()
1436 (!mp->m_dalign && mp->m_swidth)) { in xfs_fs_validate_params()
1437 xfs_warn(mp, "sunit and swidth must be specified together"); in xfs_fs_validate_params()
1441 if (mp->m_dalign && (mp->m_swidth % mp->m_dalign != 0)) { in xfs_fs_validate_params()
1442 xfs_warn(mp, in xfs_fs_validate_params()
1444 mp->m_swidth, mp->m_dalign); in xfs_fs_validate_params()
1448 if (mp->m_logbufs != -1 && in xfs_fs_validate_params()
1449 mp->m_logbufs != 0 && in xfs_fs_validate_params()
1450 (mp->m_logbufs < XLOG_MIN_ICLOGS || in xfs_fs_validate_params()
1451 mp->m_logbufs > XLOG_MAX_ICLOGS)) { in xfs_fs_validate_params()
1452 xfs_warn(mp, "invalid logbufs value: %d [not %d-%d]", in xfs_fs_validate_params()
1453 mp->m_logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS); in xfs_fs_validate_params()
1457 if (mp->m_logbsize != -1 && in xfs_fs_validate_params()
1458 mp->m_logbsize != 0 && in xfs_fs_validate_params()
1459 (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE || in xfs_fs_validate_params()
1460 mp->m_logbsize > XLOG_MAX_RECORD_BSIZE || in xfs_fs_validate_params()
1461 !is_power_of_2(mp->m_logbsize))) { in xfs_fs_validate_params()
1462 xfs_warn(mp, in xfs_fs_validate_params()
1464 mp->m_logbsize); in xfs_fs_validate_params()
1468 if (xfs_has_allocsize(mp) && in xfs_fs_validate_params()
1469 (mp->m_allocsize_log > XFS_MAX_IO_LOG || in xfs_fs_validate_params()
1470 mp->m_allocsize_log < XFS_MIN_IO_LOG)) { in xfs_fs_validate_params()
1471 xfs_warn(mp, "invalid log iosize: %d [not %d-%d]", in xfs_fs_validate_params()
1472 mp->m_allocsize_log, XFS_MIN_IO_LOG, XFS_MAX_IO_LOG); in xfs_fs_validate_params()
1499 struct xfs_mount *mp = sb->s_fs_info; in xfs_fs_fill_super() local
1503 mp->m_super = sb; in xfs_fs_fill_super()
1511 set_bit(XFS_OPSTATE_READONLY, &mp->m_opstate); in xfs_fs_fill_super()
1513 mp->m_features |= XFS_FEAT_DIRSYNC; in xfs_fs_fill_super()
1515 mp->m_features |= XFS_FEAT_WSYNC; in xfs_fs_fill_super()
1517 error = xfs_fs_validate_params(mp); in xfs_fs_fill_super()
1536 xfs_notice(mp, "Delaying mount for %d seconds.", in xfs_fs_fill_super()
1544 error = xfs_open_devices(mp); in xfs_fs_fill_super()
1549 mp->m_debugfs = xfs_debugfs_mkdir(mp->m_super->s_id, in xfs_fs_fill_super()
1552 mp->m_debugfs = NULL; in xfs_fs_fill_super()
1555 error = xfs_init_mount_workqueues(mp); in xfs_fs_fill_super()
1559 error = xfs_init_percpu_counters(mp); in xfs_fs_fill_super()
1563 error = xfs_inodegc_init_percpu(mp); in xfs_fs_fill_super()
1568 mp->m_stats.xs_stats = alloc_percpu(struct xfsstats); in xfs_fs_fill_super()
1569 if (!mp->m_stats.xs_stats) { in xfs_fs_fill_super()
1574 error = xchk_mount_stats_alloc(mp); in xfs_fs_fill_super()
1578 error = xfs_readsb(mp, flags); in xfs_fs_fill_super()
1582 error = xfs_finish_flags(mp); in xfs_fs_fill_super()
1586 error = xfs_setup_devices(mp); in xfs_fs_fill_super()
1591 if (!xfs_has_crc(mp)) { in xfs_fs_fill_super()
1593 xfs_warn_once(mp, in xfs_fs_fill_super()
1596 xfs_warn(mp, in xfs_fs_fill_super()
1604 if (xfs_has_asciici(mp)) { in xfs_fs_fill_super()
1606 xfs_warn_once(mp, in xfs_fs_fill_super()
1609 xfs_warn(mp, in xfs_fs_fill_super()
1617 if (xfs_has_needsrepair(mp)) { in xfs_fs_fill_super()
1618 xfs_warn(mp, "Filesystem needs repair. Please run xfs_repair."); in xfs_fs_fill_super()
1628 if (mp->m_sb.sb_inprogress) { in xfs_fs_fill_super()
1629 xfs_warn(mp, "Offline file system operation in progress!"); in xfs_fs_fill_super()
1637 if (mp->m_sb.sb_blocksize > PAGE_SIZE) { in xfs_fs_fill_super()
1638 xfs_warn(mp, in xfs_fs_fill_super()
1641 mp->m_sb.sb_blocksize, PAGE_SIZE); in xfs_fs_fill_super()
1647 if (xfs_sb_validate_fsb_count(&mp->m_sb, mp->m_sb.sb_dblocks) || in xfs_fs_fill_super()
1648 xfs_sb_validate_fsb_count(&mp->m_sb, mp->m_sb.sb_rblocks)) { in xfs_fs_fill_super()
1649 xfs_warn(mp, in xfs_fs_fill_super()
1666 if (!xfs_verify_fileoff(mp, XFS_B_TO_FSBT(mp, MAX_LFS_FILESIZE))) { in xfs_fs_fill_super()
1667 xfs_warn(mp, in xfs_fs_fill_super()
1669 XFS_B_TO_FSBT(mp, MAX_LFS_FILESIZE), in xfs_fs_fill_super()
1675 error = xfs_filestream_mount(mp); in xfs_fs_fill_super()
1684 sb->s_blocksize = mp->m_sb.sb_blocksize; in xfs_fs_fill_super()
1689 if (xfs_has_bigtime(mp)) { in xfs_fs_fill_super()
1696 trace_xfs_inode_timestamp_range(mp, sb->s_time_min, sb->s_time_max); in xfs_fs_fill_super()
1702 if (xfs_has_crc(mp)) in xfs_fs_fill_super()
1705 if (xfs_has_dax_always(mp)) { in xfs_fs_fill_super()
1706 error = xfs_setup_dax_always(mp); in xfs_fs_fill_super()
1711 if (xfs_has_discard(mp) && !bdev_max_discard_sectors(sb->s_bdev)) { in xfs_fs_fill_super()
1712 xfs_warn(mp, in xfs_fs_fill_super()
1714 mp->m_features &= ~XFS_FEAT_DISCARD; in xfs_fs_fill_super()
1717 if (xfs_has_reflink(mp)) { in xfs_fs_fill_super()
1718 if (mp->m_sb.sb_rblocks) { in xfs_fs_fill_super()
1719 xfs_alert(mp, in xfs_fs_fill_super()
1726 xfs_info(mp, "using DEBUG-only always_cow mode."); in xfs_fs_fill_super()
1727 mp->m_always_cow = true; in xfs_fs_fill_super()
1731 if (xfs_has_rmapbt(mp) && mp->m_sb.sb_rblocks) { in xfs_fs_fill_super()
1732 xfs_alert(mp, in xfs_fs_fill_super()
1738 error = xfs_mountfs(mp); in xfs_fs_fill_super()
1742 root = igrab(VFS_I(mp->m_rootip)); in xfs_fs_fill_super()
1756 xfs_filestream_unmount(mp); in xfs_fs_fill_super()
1758 xfs_freesb(mp); in xfs_fs_fill_super()
1760 xchk_mount_stats_free(mp); in xfs_fs_fill_super()
1762 free_percpu(mp->m_stats.xs_stats); in xfs_fs_fill_super()
1764 xfs_inodegc_free_percpu(mp); in xfs_fs_fill_super()
1766 xfs_destroy_percpu_counters(mp); in xfs_fs_fill_super()
1768 xfs_destroy_mount_workqueues(mp); in xfs_fs_fill_super()
1770 xfs_shutdown_devices(mp); in xfs_fs_fill_super()
1774 xfs_filestream_unmount(mp); in xfs_fs_fill_super()
1775 xfs_unmountfs(mp); in xfs_fs_fill_super()
1788 struct xfs_mount *mp) in xfs_remount_rw() argument
1790 struct xfs_sb *sbp = &mp->m_sb; in xfs_remount_rw()
1793 if (xfs_has_norecovery(mp)) { in xfs_remount_rw()
1794 xfs_warn(mp, in xfs_remount_rw()
1801 xfs_warn(mp, in xfs_remount_rw()
1808 clear_bit(XFS_OPSTATE_READONLY, &mp->m_opstate); in xfs_remount_rw()
1814 if (mp->m_update_sb) { in xfs_remount_rw()
1815 error = xfs_sync_sb(mp, false); in xfs_remount_rw()
1817 xfs_warn(mp, "failed to write sb changes"); in xfs_remount_rw()
1820 mp->m_update_sb = false; in xfs_remount_rw()
1827 xfs_restore_resvblks(mp); in xfs_remount_rw()
1828 xfs_log_work_queue(mp); in xfs_remount_rw()
1829 xfs_blockgc_start(mp); in xfs_remount_rw()
1832 error = xfs_fs_reserve_ag_blocks(mp); in xfs_remount_rw()
1837 xfs_inodegc_start(mp); in xfs_remount_rw()
1844 struct xfs_mount *mp) in xfs_remount_ro() argument
1852 error = sync_filesystem(mp->m_super); in xfs_remount_ro()
1860 xfs_blockgc_stop(mp); in xfs_remount_ro()
1868 error = xfs_blockgc_free_space(mp, &icw); in xfs_remount_ro()
1870 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_remount_ro()
1881 xfs_inodegc_stop(mp); in xfs_remount_ro()
1884 error = xfs_fs_unreserve_ag_blocks(mp); in xfs_remount_ro()
1886 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_remount_ro()
1897 xfs_save_resvblks(mp); in xfs_remount_ro()
1899 xfs_log_clean(mp); in xfs_remount_ro()
1900 set_bit(XFS_OPSTATE_READONLY, &mp->m_opstate); in xfs_remount_ro()
1921 struct xfs_mount *mp = XFS_M(fc->root->d_sb); in xfs_fs_reconfigure() local
1927 if (xfs_has_crc(mp)) in xfs_fs_reconfigure()
1935 if (xfs_has_small_inums(mp) && !xfs_has_small_inums(new_mp)) { in xfs_fs_reconfigure()
1936 mp->m_features &= ~XFS_FEAT_SMALL_INUMS; in xfs_fs_reconfigure()
1937 mp->m_maxagi = xfs_set_inode_alloc(mp, mp->m_sb.sb_agcount); in xfs_fs_reconfigure()
1941 if (!xfs_has_small_inums(mp) && xfs_has_small_inums(new_mp)) { in xfs_fs_reconfigure()
1942 mp->m_features |= XFS_FEAT_SMALL_INUMS; in xfs_fs_reconfigure()
1943 mp->m_maxagi = xfs_set_inode_alloc(mp, mp->m_sb.sb_agcount); in xfs_fs_reconfigure()
1947 if (xfs_is_readonly(mp) && !(flags & SB_RDONLY)) { in xfs_fs_reconfigure()
1948 error = xfs_remount_rw(mp); in xfs_fs_reconfigure()
1954 if (!xfs_is_readonly(mp) && (flags & SB_RDONLY)) { in xfs_fs_reconfigure()
1955 error = xfs_remount_ro(mp); in xfs_fs_reconfigure()
1967 struct xfs_mount *mp = fc->s_fs_info; in xfs_fs_free() local
1970 * mp is stored in the fs_context when it is initialized. in xfs_fs_free()
1971 * mp is transferred to the superblock on a successful mount, in xfs_fs_free()
1975 if (mp) in xfs_fs_free()
1976 xfs_mount_free(mp); in xfs_fs_free()
1994 struct xfs_mount *mp; in xfs_init_fs_context() local
1996 mp = kmem_alloc(sizeof(struct xfs_mount), KM_ZERO); in xfs_init_fs_context()
1997 if (!mp) in xfs_init_fs_context()
2000 spin_lock_init(&mp->m_sb_lock); in xfs_init_fs_context()
2001 INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC); in xfs_init_fs_context()
2002 spin_lock_init(&mp->m_perag_lock); in xfs_init_fs_context()
2003 mutex_init(&mp->m_growlock); in xfs_init_fs_context()
2004 INIT_WORK(&mp->m_flush_inodes_work, xfs_flush_inodes_worker); in xfs_init_fs_context()
2005 INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker); in xfs_init_fs_context()
2006 mp->m_kobj.kobject.kset = xfs_kset; in xfs_init_fs_context()
2013 mp->m_finobt_nores = true; in xfs_init_fs_context()
2018 mp->m_logbufs = -1; in xfs_init_fs_context()
2019 mp->m_logbsize = -1; in xfs_init_fs_context()
2020 mp->m_allocsize_log = 16; /* 64k */ in xfs_init_fs_context()
2022 fc->s_fs_info = mp; in xfs_init_fs_context()