• Home
  • Raw
  • Download

Lines Matching refs: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|XFS_UQUOTA_ENFD)) in xfs_fs_show_options()
204 else if (mp->m_qflags & XFS_UQUOTA_ACCT) in xfs_fs_show_options()
207 if (mp->m_qflags & XFS_PQUOTA_ACCT) { in xfs_fs_show_options()
208 if (mp->m_qflags & XFS_PQUOTA_ENFD) in xfs_fs_show_options()
213 if (mp->m_qflags & XFS_GQUOTA_ACCT) { in xfs_fs_show_options()
214 if (mp->m_qflags & XFS_GQUOTA_ENFD) in xfs_fs_show_options()
220 if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) in xfs_fs_show_options()
243 struct xfs_mount *mp, in xfs_set_inode_alloc() argument
248 xfs_sb_t *sbp = &mp->m_sb; in xfs_set_inode_alloc()
257 if (M_IGEO(mp)->maxicount) { in xfs_set_inode_alloc()
270 agino = XFS_AGB_TO_AGINO(mp, sbp->sb_agblocks - 1); in xfs_set_inode_alloc()
271 ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino); in xfs_set_inode_alloc()
278 if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && ino > XFS_MAXINUMBER_32) in xfs_set_inode_alloc()
279 mp->m_flags |= XFS_MOUNT_32BITINODES; in xfs_set_inode_alloc()
281 mp->m_flags &= ~XFS_MOUNT_32BITINODES; in xfs_set_inode_alloc()
286 ino = XFS_AGINO_TO_INO(mp, index, agino); in xfs_set_inode_alloc()
288 pag = xfs_perag_get(mp, index); in xfs_set_inode_alloc()
290 if (mp->m_flags & XFS_MOUNT_32BITINODES) { in xfs_set_inode_alloc()
310 return (mp->m_flags & XFS_MOUNT_32BITINODES) ? maxagi : agcount; in xfs_set_inode_alloc()
315 xfs_mount_t *mp, in xfs_blkdev_get() argument
322 mp); in xfs_blkdev_get()
325 xfs_warn(mp, "Invalid device [%s], error=%d", name, error); in xfs_blkdev_get()
348 struct xfs_mount *mp) in xfs_close_devices() argument
350 struct dax_device *dax_ddev = mp->m_ddev_targp->bt_daxdev; in xfs_close_devices()
352 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { in xfs_close_devices()
353 struct block_device *logdev = mp->m_logdev_targp->bt_bdev; in xfs_close_devices()
354 struct dax_device *dax_logdev = mp->m_logdev_targp->bt_daxdev; in xfs_close_devices()
356 xfs_free_buftarg(mp->m_logdev_targp); in xfs_close_devices()
360 if (mp->m_rtdev_targp) { in xfs_close_devices()
361 struct block_device *rtdev = mp->m_rtdev_targp->bt_bdev; in xfs_close_devices()
362 struct dax_device *dax_rtdev = mp->m_rtdev_targp->bt_daxdev; in xfs_close_devices()
364 xfs_free_buftarg(mp->m_rtdev_targp); in xfs_close_devices()
368 xfs_free_buftarg(mp->m_ddev_targp); in xfs_close_devices()
384 struct xfs_mount *mp) in xfs_open_devices() argument
386 struct block_device *ddev = mp->m_super->s_bdev; in xfs_open_devices()
395 if (mp->m_logname) { in xfs_open_devices()
396 error = xfs_blkdev_get(mp, mp->m_logname, &logdev); in xfs_open_devices()
402 if (mp->m_rtname) { in xfs_open_devices()
403 error = xfs_blkdev_get(mp, mp->m_rtname, &rtdev); in xfs_open_devices()
408 xfs_warn(mp, in xfs_open_devices()
420 mp->m_ddev_targp = xfs_alloc_buftarg(mp, ddev, dax_ddev); in xfs_open_devices()
421 if (!mp->m_ddev_targp) in xfs_open_devices()
425 mp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev, dax_rtdev); in xfs_open_devices()
426 if (!mp->m_rtdev_targp) in xfs_open_devices()
431 mp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev, dax_logdev); in xfs_open_devices()
432 if (!mp->m_logdev_targp) in xfs_open_devices()
435 mp->m_logdev_targp = mp->m_ddev_targp; in xfs_open_devices()
441 if (mp->m_rtdev_targp) in xfs_open_devices()
442 xfs_free_buftarg(mp->m_rtdev_targp); in xfs_open_devices()
444 xfs_free_buftarg(mp->m_ddev_targp); in xfs_open_devices()
463 struct xfs_mount *mp) in xfs_setup_devices() argument
467 error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_sectsize); in xfs_setup_devices()
471 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { in xfs_setup_devices()
474 if (xfs_sb_version_hassector(&mp->m_sb)) in xfs_setup_devices()
475 log_sector_size = mp->m_sb.sb_logsectsize; in xfs_setup_devices()
476 error = xfs_setsize_buftarg(mp->m_logdev_targp, in xfs_setup_devices()
481 if (mp->m_rtdev_targp) { in xfs_setup_devices()
482 error = xfs_setsize_buftarg(mp->m_rtdev_targp, in xfs_setup_devices()
483 mp->m_sb.sb_sectsize); in xfs_setup_devices()
493 struct xfs_mount *mp) in xfs_init_mount_workqueues() argument
495 mp->m_buf_workqueue = alloc_workqueue("xfs-buf/%s", in xfs_init_mount_workqueues()
496 WQ_MEM_RECLAIM|WQ_FREEZABLE, 1, mp->m_super->s_id); in xfs_init_mount_workqueues()
497 if (!mp->m_buf_workqueue) in xfs_init_mount_workqueues()
500 mp->m_unwritten_workqueue = alloc_workqueue("xfs-conv/%s", in xfs_init_mount_workqueues()
501 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
502 if (!mp->m_unwritten_workqueue) in xfs_init_mount_workqueues()
505 mp->m_cil_workqueue = alloc_workqueue("xfs-cil/%s", in xfs_init_mount_workqueues()
507 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
508 if (!mp->m_cil_workqueue) in xfs_init_mount_workqueues()
511 mp->m_reclaim_workqueue = alloc_workqueue("xfs-reclaim/%s", in xfs_init_mount_workqueues()
512 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
513 if (!mp->m_reclaim_workqueue) in xfs_init_mount_workqueues()
516 mp->m_eofblocks_workqueue = alloc_workqueue("xfs-eofblocks/%s", in xfs_init_mount_workqueues()
517 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_super->s_id); in xfs_init_mount_workqueues()
518 if (!mp->m_eofblocks_workqueue) in xfs_init_mount_workqueues()
521 mp->m_sync_workqueue = alloc_workqueue("xfs-sync/%s", WQ_FREEZABLE, 0, in xfs_init_mount_workqueues()
522 mp->m_super->s_id); in xfs_init_mount_workqueues()
523 if (!mp->m_sync_workqueue) in xfs_init_mount_workqueues()
529 destroy_workqueue(mp->m_eofblocks_workqueue); in xfs_init_mount_workqueues()
531 destroy_workqueue(mp->m_reclaim_workqueue); in xfs_init_mount_workqueues()
533 destroy_workqueue(mp->m_cil_workqueue); in xfs_init_mount_workqueues()
535 destroy_workqueue(mp->m_unwritten_workqueue); in xfs_init_mount_workqueues()
537 destroy_workqueue(mp->m_buf_workqueue); in xfs_init_mount_workqueues()
544 struct xfs_mount *mp) in xfs_destroy_mount_workqueues() argument
546 destroy_workqueue(mp->m_sync_workqueue); in xfs_destroy_mount_workqueues()
547 destroy_workqueue(mp->m_eofblocks_workqueue); in xfs_destroy_mount_workqueues()
548 destroy_workqueue(mp->m_reclaim_workqueue); in xfs_destroy_mount_workqueues()
549 destroy_workqueue(mp->m_cil_workqueue); in xfs_destroy_mount_workqueues()
550 destroy_workqueue(mp->m_unwritten_workqueue); in xfs_destroy_mount_workqueues()
551 destroy_workqueue(mp->m_buf_workqueue); in xfs_destroy_mount_workqueues()
558 struct xfs_mount *mp = container_of(work, struct xfs_mount, in xfs_flush_inodes_worker() local
560 struct super_block *sb = mp->m_super; in xfs_flush_inodes_worker()
576 struct xfs_mount *mp) in xfs_flush_inodes() argument
582 if (flush_work(&mp->m_flush_inodes_work)) in xfs_flush_inodes()
585 queue_work(mp->m_sync_workqueue, &mp->m_flush_inodes_work); in xfs_flush_inodes()
586 flush_work(&mp->m_flush_inodes_work); in xfs_flush_inodes()
672 struct xfs_mount *mp = ip->i_mount; in xfs_fs_dirty_inode() local
680 if (xfs_trans_alloc(mp, &M_RES(mp)->tr_fsyncts, 0, 0, 0, &tp)) in xfs_fs_dirty_inode()
745 struct xfs_mount *mp) in xfs_mount_free() argument
747 kfree(mp->m_rtname); in xfs_mount_free()
748 kfree(mp->m_logname); in xfs_mount_free()
749 kmem_free(mp); in xfs_mount_free()
757 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_sync_fs() local
765 xfs_log_force(mp, XFS_LOG_SYNC); in xfs_fs_sync_fs()
772 flush_delayed_work(&mp->m_log->l_work); in xfs_fs_sync_fs()
783 struct xfs_mount *mp = XFS_M(dentry->d_sb); in xfs_fs_statfs() local
784 xfs_sb_t *sbp = &mp->m_sb; in xfs_fs_statfs()
796 id = huge_encode_dev(mp->m_ddev_targp->bt_dev); in xfs_fs_statfs()
799 icount = percpu_counter_sum(&mp->m_icount); in xfs_fs_statfs()
800 ifree = percpu_counter_sum(&mp->m_ifree); in xfs_fs_statfs()
801 fdblocks = percpu_counter_sum(&mp->m_fdblocks); in xfs_fs_statfs()
803 spin_lock(&mp->m_sb_lock); in xfs_fs_statfs()
807 spin_unlock(&mp->m_sb_lock); in xfs_fs_statfs()
810 statp->f_bfree = max_t(int64_t, fdblocks - mp->m_alloc_set_aside, 0); in xfs_fs_statfs()
813 fakeinos = XFS_FSB_TO_INO(mp, statp->f_bfree); in xfs_fs_statfs()
815 if (M_IGEO(mp)->maxicount) in xfs_fs_statfs()
818 M_IGEO(mp)->maxicount); in xfs_fs_statfs()
831 ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD))) == in xfs_fs_statfs()
835 if (XFS_IS_REALTIME_MOUNT(mp) && in xfs_fs_statfs()
846 xfs_save_resvblks(struct xfs_mount *mp) in xfs_save_resvblks() argument
850 mp->m_resblks_save = mp->m_resblks; in xfs_save_resvblks()
851 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_save_resvblks()
855 xfs_restore_resvblks(struct xfs_mount *mp) in xfs_restore_resvblks() argument
859 if (mp->m_resblks_save) { in xfs_restore_resvblks()
860 resblks = mp->m_resblks_save; in xfs_restore_resvblks()
861 mp->m_resblks_save = 0; in xfs_restore_resvblks()
863 resblks = xfs_default_resblks(mp); in xfs_restore_resvblks()
865 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_restore_resvblks()
883 struct xfs_mount *mp) in xfs_quiesce_attr() argument
887 cancel_delayed_work_sync(&mp->m_log->l_work); in xfs_quiesce_attr()
890 xfs_log_force(mp, XFS_LOG_SYNC); in xfs_quiesce_attr()
894 error = xfs_log_sbcount(mp); in xfs_quiesce_attr()
896 xfs_warn(mp, "xfs_attr_quiesce: failed to log sb changes. " in xfs_quiesce_attr()
898 xfs_log_quiesce(mp); in xfs_quiesce_attr()
911 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_freeze() local
921 xfs_stop_block_reaping(mp); in xfs_fs_freeze()
922 xfs_save_resvblks(mp); in xfs_fs_freeze()
923 xfs_quiesce_attr(mp); in xfs_fs_freeze()
924 ret = xfs_sync_sb(mp, true); in xfs_fs_freeze()
933 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_unfreeze() local
935 xfs_restore_resvblks(mp); in xfs_fs_unfreeze()
936 xfs_log_work_queue(mp); in xfs_fs_unfreeze()
937 xfs_start_block_reaping(mp); in xfs_fs_unfreeze()
947 struct xfs_mount *mp) in xfs_finish_flags() argument
949 int ronly = (mp->m_flags & XFS_MOUNT_RDONLY); in xfs_finish_flags()
952 if (xfs_sb_version_haslogv2(&mp->m_sb)) { in xfs_finish_flags()
953 if (mp->m_logbsize <= 0 && in xfs_finish_flags()
954 mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
955 mp->m_logbsize = mp->m_sb.sb_logsunit; in xfs_finish_flags()
956 } else if (mp->m_logbsize > 0 && in xfs_finish_flags()
957 mp->m_logbsize < mp->m_sb.sb_logsunit) { in xfs_finish_flags()
958 xfs_warn(mp, in xfs_finish_flags()
964 if (mp->m_logbsize > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
965 xfs_warn(mp, in xfs_finish_flags()
974 if (xfs_sb_version_hascrc(&mp->m_sb) && in xfs_finish_flags()
975 (mp->m_flags & XFS_MOUNT_NOATTR2)) { in xfs_finish_flags()
976 xfs_warn(mp, "Cannot mount a V5 filesystem as noattr2. " in xfs_finish_flags()
985 if (xfs_sb_version_hasattr2(&mp->m_sb) && in xfs_finish_flags()
986 !(mp->m_flags & XFS_MOUNT_NOATTR2)) in xfs_finish_flags()
987 mp->m_flags |= XFS_MOUNT_ATTR2; in xfs_finish_flags()
992 if ((mp->m_sb.sb_flags & XFS_SBF_READONLY) && !ronly) { in xfs_finish_flags()
993 xfs_warn(mp, in xfs_finish_flags()
998 if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) && in xfs_finish_flags()
999 (mp->m_qflags & (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE)) && in xfs_finish_flags()
1000 !xfs_sb_version_has_pquotino(&mp->m_sb)) { in xfs_finish_flags()
1001 xfs_warn(mp, in xfs_finish_flags()
1011 struct xfs_mount *mp) in xfs_init_percpu_counters() argument
1015 error = percpu_counter_init(&mp->m_icount, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1019 error = percpu_counter_init(&mp->m_ifree, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1023 error = percpu_counter_init(&mp->m_fdblocks, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1027 error = percpu_counter_init(&mp->m_delalloc_blks, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1034 percpu_counter_destroy(&mp->m_fdblocks); in xfs_init_percpu_counters()
1036 percpu_counter_destroy(&mp->m_ifree); in xfs_init_percpu_counters()
1038 percpu_counter_destroy(&mp->m_icount); in xfs_init_percpu_counters()
1044 struct xfs_mount *mp) in xfs_reinit_percpu_counters() argument
1046 percpu_counter_set(&mp->m_icount, mp->m_sb.sb_icount); in xfs_reinit_percpu_counters()
1047 percpu_counter_set(&mp->m_ifree, mp->m_sb.sb_ifree); in xfs_reinit_percpu_counters()
1048 percpu_counter_set(&mp->m_fdblocks, mp->m_sb.sb_fdblocks); in xfs_reinit_percpu_counters()
1053 struct xfs_mount *mp) in xfs_destroy_percpu_counters() argument
1055 percpu_counter_destroy(&mp->m_icount); in xfs_destroy_percpu_counters()
1056 percpu_counter_destroy(&mp->m_ifree); in xfs_destroy_percpu_counters()
1057 percpu_counter_destroy(&mp->m_fdblocks); in xfs_destroy_percpu_counters()
1058 ASSERT(XFS_FORCED_SHUTDOWN(mp) || in xfs_destroy_percpu_counters()
1059 percpu_counter_sum(&mp->m_delalloc_blks) == 0); in xfs_destroy_percpu_counters()
1060 percpu_counter_destroy(&mp->m_delalloc_blks); in xfs_destroy_percpu_counters()
1067 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_put_super() local
1073 xfs_notice(mp, "Unmounting Filesystem"); in xfs_fs_put_super()
1074 xfs_filestream_unmount(mp); in xfs_fs_put_super()
1075 xfs_unmountfs(mp); in xfs_fs_put_super()
1077 xfs_freesb(mp); in xfs_fs_put_super()
1078 free_percpu(mp->m_stats.xs_stats); in xfs_fs_put_super()
1079 xfs_destroy_percpu_counters(mp); in xfs_fs_put_super()
1080 xfs_destroy_mount_workqueues(mp); in xfs_fs_put_super()
1081 xfs_close_devices(mp); in xfs_fs_put_super()
1084 xfs_mount_free(mp); in xfs_fs_put_super()
1166 struct xfs_mount *mp = fc->s_fs_info; in xfs_fc_parse_param() local
1177 mp->m_logbufs = result.uint_32; in xfs_fc_parse_param()
1180 if (suffix_kstrtoint(param->string, 10, &mp->m_logbsize)) in xfs_fc_parse_param()
1184 kfree(mp->m_logname); in xfs_fc_parse_param()
1185 mp->m_logname = kstrdup(param->string, GFP_KERNEL); in xfs_fc_parse_param()
1186 if (!mp->m_logname) in xfs_fc_parse_param()
1190 kfree(mp->m_rtname); in xfs_fc_parse_param()
1191 mp->m_rtname = kstrdup(param->string, GFP_KERNEL); in xfs_fc_parse_param()
1192 if (!mp->m_rtname) in xfs_fc_parse_param()
1198 mp->m_allocsize_log = ffs(size) - 1; in xfs_fc_parse_param()
1199 mp->m_flags |= XFS_MOUNT_ALLOCSIZE; in xfs_fc_parse_param()
1203 mp->m_flags |= XFS_MOUNT_GRPID; in xfs_fc_parse_param()
1207 mp->m_flags &= ~XFS_MOUNT_GRPID; in xfs_fc_parse_param()
1210 mp->m_flags |= XFS_MOUNT_WSYNC; in xfs_fc_parse_param()
1213 mp->m_flags |= XFS_MOUNT_NORECOVERY; in xfs_fc_parse_param()
1216 mp->m_flags |= XFS_MOUNT_NOALIGN; in xfs_fc_parse_param()
1219 mp->m_flags |= XFS_MOUNT_SWALLOC; in xfs_fc_parse_param()
1222 mp->m_dalign = result.uint_32; in xfs_fc_parse_param()
1225 mp->m_swidth = result.uint_32; in xfs_fc_parse_param()
1228 mp->m_flags |= XFS_MOUNT_SMALL_INUMS; in xfs_fc_parse_param()
1231 mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; in xfs_fc_parse_param()
1234 mp->m_flags |= XFS_MOUNT_NOUUID; in xfs_fc_parse_param()
1237 mp->m_flags |= XFS_MOUNT_LARGEIO; in xfs_fc_parse_param()
1240 mp->m_flags &= ~XFS_MOUNT_LARGEIO; in xfs_fc_parse_param()
1243 mp->m_flags |= XFS_MOUNT_FILESTREAMS; in xfs_fc_parse_param()
1246 mp->m_qflags &= ~XFS_ALL_QUOTA_ACCT; in xfs_fc_parse_param()
1247 mp->m_qflags &= ~XFS_ALL_QUOTA_ENFD; in xfs_fc_parse_param()
1248 mp->m_qflags &= ~XFS_ALL_QUOTA_ACTIVE; in xfs_fc_parse_param()
1253 mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | in xfs_fc_parse_param()
1258 mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE); in xfs_fc_parse_param()
1259 mp->m_qflags &= ~XFS_UQUOTA_ENFD; in xfs_fc_parse_param()
1263 mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | in xfs_fc_parse_param()
1267 mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); in xfs_fc_parse_param()
1268 mp->m_qflags &= ~XFS_PQUOTA_ENFD; in xfs_fc_parse_param()
1272 mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | in xfs_fc_parse_param()
1276 mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); in xfs_fc_parse_param()
1277 mp->m_qflags &= ~XFS_GQUOTA_ENFD; in xfs_fc_parse_param()
1280 mp->m_flags |= XFS_MOUNT_DISCARD; in xfs_fc_parse_param()
1283 mp->m_flags &= ~XFS_MOUNT_DISCARD; in xfs_fc_parse_param()
1287 xfs_mount_set_dax_mode(mp, XFS_DAX_ALWAYS); in xfs_fc_parse_param()
1290 xfs_mount_set_dax_mode(mp, result.uint_32); in xfs_fc_parse_param()
1295 xfs_warn(mp, "%s mount option is deprecated.", param->key); in xfs_fc_parse_param()
1296 mp->m_flags |= XFS_MOUNT_IKEEP; in xfs_fc_parse_param()
1299 xfs_warn(mp, "%s mount option is deprecated.", param->key); in xfs_fc_parse_param()
1300 mp->m_flags &= ~XFS_MOUNT_IKEEP; in xfs_fc_parse_param()
1303 xfs_warn(mp, "%s mount option is deprecated.", param->key); in xfs_fc_parse_param()
1304 mp->m_flags |= XFS_MOUNT_ATTR2; in xfs_fc_parse_param()
1307 xfs_warn(mp, "%s mount option is deprecated.", param->key); in xfs_fc_parse_param()
1308 mp->m_flags &= ~XFS_MOUNT_ATTR2; in xfs_fc_parse_param()
1309 mp->m_flags |= XFS_MOUNT_NOATTR2; in xfs_fc_parse_param()
1312 xfs_warn(mp, "unknown mount option [%s].", param->key); in xfs_fc_parse_param()
1321 struct xfs_mount *mp) in xfs_fc_validate_params() argument
1326 if ((mp->m_flags & XFS_MOUNT_NORECOVERY) && in xfs_fc_validate_params()
1327 !(mp->m_flags & XFS_MOUNT_RDONLY)) { in xfs_fc_validate_params()
1328 xfs_warn(mp, "no-recovery mounts must be read-only."); in xfs_fc_validate_params()
1332 if ((mp->m_flags & XFS_MOUNT_NOALIGN) && in xfs_fc_validate_params()
1333 (mp->m_dalign || mp->m_swidth)) { in xfs_fc_validate_params()
1334 xfs_warn(mp, in xfs_fc_validate_params()
1339 if (!IS_ENABLED(CONFIG_XFS_QUOTA) && mp->m_qflags != 0) { in xfs_fc_validate_params()
1340 xfs_warn(mp, "quota support not available in this kernel."); in xfs_fc_validate_params()
1344 if ((mp->m_dalign && !mp->m_swidth) || in xfs_fc_validate_params()
1345 (!mp->m_dalign && mp->m_swidth)) { in xfs_fc_validate_params()
1346 xfs_warn(mp, "sunit and swidth must be specified together"); in xfs_fc_validate_params()
1350 if (mp->m_dalign && (mp->m_swidth % mp->m_dalign != 0)) { in xfs_fc_validate_params()
1351 xfs_warn(mp, in xfs_fc_validate_params()
1353 mp->m_swidth, mp->m_dalign); in xfs_fc_validate_params()
1357 if (mp->m_logbufs != -1 && in xfs_fc_validate_params()
1358 mp->m_logbufs != 0 && in xfs_fc_validate_params()
1359 (mp->m_logbufs < XLOG_MIN_ICLOGS || in xfs_fc_validate_params()
1360 mp->m_logbufs > XLOG_MAX_ICLOGS)) { in xfs_fc_validate_params()
1361 xfs_warn(mp, "invalid logbufs value: %d [not %d-%d]", in xfs_fc_validate_params()
1362 mp->m_logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS); in xfs_fc_validate_params()
1366 if (mp->m_logbsize != -1 && in xfs_fc_validate_params()
1367 mp->m_logbsize != 0 && in xfs_fc_validate_params()
1368 (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE || in xfs_fc_validate_params()
1369 mp->m_logbsize > XLOG_MAX_RECORD_BSIZE || in xfs_fc_validate_params()
1370 !is_power_of_2(mp->m_logbsize))) { in xfs_fc_validate_params()
1371 xfs_warn(mp, in xfs_fc_validate_params()
1373 mp->m_logbsize); in xfs_fc_validate_params()
1377 if ((mp->m_flags & XFS_MOUNT_ALLOCSIZE) && in xfs_fc_validate_params()
1378 (mp->m_allocsize_log > XFS_MAX_IO_LOG || in xfs_fc_validate_params()
1379 mp->m_allocsize_log < XFS_MIN_IO_LOG)) { in xfs_fc_validate_params()
1380 xfs_warn(mp, "invalid log iosize: %d [not %d-%d]", in xfs_fc_validate_params()
1381 mp->m_allocsize_log, XFS_MIN_IO_LOG, XFS_MAX_IO_LOG); in xfs_fc_validate_params()
1393 struct xfs_mount *mp = sb->s_fs_info; in xfs_fc_fill_super() local
1397 mp->m_super = sb; in xfs_fc_fill_super()
1399 error = xfs_fc_validate_params(mp); in xfs_fc_fill_super()
1418 xfs_notice(mp, "Delaying mount for %d seconds.", in xfs_fc_fill_super()
1426 error = xfs_open_devices(mp); in xfs_fc_fill_super()
1430 error = xfs_init_mount_workqueues(mp); in xfs_fc_fill_super()
1434 error = xfs_init_percpu_counters(mp); in xfs_fc_fill_super()
1439 mp->m_stats.xs_stats = alloc_percpu(struct xfsstats); in xfs_fc_fill_super()
1440 if (!mp->m_stats.xs_stats) { in xfs_fc_fill_super()
1445 error = xfs_readsb(mp, flags); in xfs_fc_fill_super()
1449 error = xfs_finish_flags(mp); in xfs_fc_fill_super()
1453 error = xfs_setup_devices(mp); in xfs_fc_fill_super()
1458 if (!xfs_sb_version_hascrc(&mp->m_sb)) { in xfs_fc_fill_super()
1460 xfs_warn_once(mp, in xfs_fc_fill_super()
1463 xfs_warn(mp, in xfs_fc_fill_super()
1481 if (XFS_B_TO_FSBT(mp, MAX_LFS_FILESIZE) > XFS_MAX_FILEOFF) { in xfs_fc_fill_super()
1482 xfs_warn(mp, in xfs_fc_fill_super()
1484 XFS_B_TO_FSBT(mp, MAX_LFS_FILESIZE), in xfs_fc_fill_super()
1490 error = xfs_filestream_mount(mp); in xfs_fc_fill_super()
1499 sb->s_blocksize = mp->m_sb.sb_blocksize; in xfs_fc_fill_super()
1504 if (xfs_sb_version_hasbigtime(&mp->m_sb)) { in xfs_fc_fill_super()
1511 trace_xfs_inode_timestamp_range(mp, sb->s_time_min, sb->s_time_max); in xfs_fc_fill_super()
1517 if (XFS_SB_VERSION_NUM(&mp->m_sb) == XFS_SB_VERSION_5) in xfs_fc_fill_super()
1520 if (xfs_sb_version_hasbigtime(&mp->m_sb)) in xfs_fc_fill_super()
1521 xfs_warn(mp, in xfs_fc_fill_super()
1524 if (mp->m_flags & XFS_MOUNT_DAX_ALWAYS) { in xfs_fc_fill_super()
1527 xfs_warn(mp, in xfs_fc_fill_super()
1530 datadev_is_dax = bdev_dax_supported(mp->m_ddev_targp->bt_bdev, in xfs_fc_fill_super()
1532 if (mp->m_rtdev_targp) in xfs_fc_fill_super()
1534 mp->m_rtdev_targp->bt_bdev, sb->s_blocksize); in xfs_fc_fill_super()
1536 xfs_alert(mp, in xfs_fc_fill_super()
1538 xfs_mount_set_dax_mode(mp, XFS_DAX_NEVER); in xfs_fc_fill_super()
1540 if (xfs_sb_version_hasreflink(&mp->m_sb)) { in xfs_fc_fill_super()
1541 xfs_alert(mp, in xfs_fc_fill_super()
1548 if (mp->m_flags & XFS_MOUNT_DISCARD) { in xfs_fc_fill_super()
1552 xfs_warn(mp, "mounting with \"discard\" option, but " in xfs_fc_fill_super()
1554 mp->m_flags &= ~XFS_MOUNT_DISCARD; in xfs_fc_fill_super()
1558 if (xfs_sb_version_hasreflink(&mp->m_sb)) { in xfs_fc_fill_super()
1559 if (mp->m_sb.sb_rblocks) { in xfs_fc_fill_super()
1560 xfs_alert(mp, in xfs_fc_fill_super()
1567 xfs_info(mp, "using DEBUG-only always_cow mode."); in xfs_fc_fill_super()
1568 mp->m_always_cow = true; in xfs_fc_fill_super()
1572 if (xfs_sb_version_hasrmapbt(&mp->m_sb) && mp->m_sb.sb_rblocks) { in xfs_fc_fill_super()
1573 xfs_alert(mp, in xfs_fc_fill_super()
1579 if (xfs_sb_version_hasinobtcounts(&mp->m_sb)) in xfs_fc_fill_super()
1580 xfs_warn(mp, in xfs_fc_fill_super()
1583 error = xfs_mountfs(mp); in xfs_fc_fill_super()
1587 root = igrab(VFS_I(mp->m_rootip)); in xfs_fc_fill_super()
1601 xfs_filestream_unmount(mp); in xfs_fc_fill_super()
1603 xfs_freesb(mp); in xfs_fc_fill_super()
1605 free_percpu(mp->m_stats.xs_stats); in xfs_fc_fill_super()
1607 xfs_destroy_percpu_counters(mp); in xfs_fc_fill_super()
1609 xfs_destroy_mount_workqueues(mp); in xfs_fc_fill_super()
1611 xfs_close_devices(mp); in xfs_fc_fill_super()
1614 xfs_mount_free(mp); in xfs_fc_fill_super()
1618 xfs_filestream_unmount(mp); in xfs_fc_fill_super()
1619 xfs_unmountfs(mp); in xfs_fc_fill_super()
1632 struct xfs_mount *mp) in xfs_remount_rw() argument
1634 struct xfs_sb *sbp = &mp->m_sb; in xfs_remount_rw()
1637 if (mp->m_flags & XFS_MOUNT_NORECOVERY) { in xfs_remount_rw()
1638 xfs_warn(mp, in xfs_remount_rw()
1645 xfs_warn(mp, in xfs_remount_rw()
1652 mp->m_flags &= ~XFS_MOUNT_RDONLY; in xfs_remount_rw()
1658 if (mp->m_update_sb) { in xfs_remount_rw()
1659 error = xfs_sync_sb(mp, false); in xfs_remount_rw()
1661 xfs_warn(mp, "failed to write sb changes"); in xfs_remount_rw()
1664 mp->m_update_sb = false; in xfs_remount_rw()
1671 xfs_restore_resvblks(mp); in xfs_remount_rw()
1672 xfs_log_work_queue(mp); in xfs_remount_rw()
1675 error = xfs_reflink_recover_cow(mp); in xfs_remount_rw()
1677 xfs_err(mp, in xfs_remount_rw()
1679 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_remount_rw()
1682 xfs_start_block_reaping(mp); in xfs_remount_rw()
1685 error = xfs_fs_reserve_ag_blocks(mp); in xfs_remount_rw()
1694 struct xfs_mount *mp) in xfs_remount_ro() argument
1702 xfs_stop_block_reaping(mp); in xfs_remount_ro()
1705 error = xfs_icache_free_cowblocks(mp, NULL); in xfs_remount_ro()
1707 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_remount_ro()
1712 error = xfs_fs_unreserve_ag_blocks(mp); in xfs_remount_ro()
1714 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_remount_ro()
1725 xfs_save_resvblks(mp); in xfs_remount_ro()
1727 xfs_quiesce_attr(mp); in xfs_remount_ro()
1728 mp->m_flags |= XFS_MOUNT_RDONLY; in xfs_remount_ro()
1749 struct xfs_mount *mp = XFS_M(fc->root->d_sb); in xfs_fc_reconfigure() local
1751 xfs_sb_t *sbp = &mp->m_sb; in xfs_fc_reconfigure()
1756 if (XFS_SB_VERSION_NUM(&mp->m_sb) == XFS_SB_VERSION_5) in xfs_fc_reconfigure()
1763 sync_filesystem(mp->m_super); in xfs_fc_reconfigure()
1766 if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && in xfs_fc_reconfigure()
1768 mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; in xfs_fc_reconfigure()
1769 mp->m_maxagi = xfs_set_inode_alloc(mp, sbp->sb_agcount); in xfs_fc_reconfigure()
1773 if (!(mp->m_flags & XFS_MOUNT_SMALL_INUMS) && in xfs_fc_reconfigure()
1775 mp->m_flags |= XFS_MOUNT_SMALL_INUMS; in xfs_fc_reconfigure()
1776 mp->m_maxagi = xfs_set_inode_alloc(mp, sbp->sb_agcount); in xfs_fc_reconfigure()
1780 if ((mp->m_flags & XFS_MOUNT_RDONLY) && !(flags & SB_RDONLY)) { in xfs_fc_reconfigure()
1781 error = xfs_remount_rw(mp); in xfs_fc_reconfigure()
1787 if (!(mp->m_flags & XFS_MOUNT_RDONLY) && (flags & SB_RDONLY)) { in xfs_fc_reconfigure()
1788 error = xfs_remount_ro(mp); in xfs_fc_reconfigure()
1799 struct xfs_mount *mp = fc->s_fs_info; in xfs_fc_free() local
1807 if (mp) in xfs_fc_free()
1808 xfs_mount_free(mp); in xfs_fc_free()
1821 struct xfs_mount *mp; in xfs_init_fs_context() local
1823 mp = kmem_alloc(sizeof(struct xfs_mount), KM_ZERO); in xfs_init_fs_context()
1824 if (!mp) in xfs_init_fs_context()
1827 spin_lock_init(&mp->m_sb_lock); in xfs_init_fs_context()
1828 spin_lock_init(&mp->m_agirotor_lock); in xfs_init_fs_context()
1829 INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC); in xfs_init_fs_context()
1830 spin_lock_init(&mp->m_perag_lock); in xfs_init_fs_context()
1831 mutex_init(&mp->m_growlock); in xfs_init_fs_context()
1832 INIT_WORK(&mp->m_flush_inodes_work, xfs_flush_inodes_worker); in xfs_init_fs_context()
1833 INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker); in xfs_init_fs_context()
1834 INIT_DELAYED_WORK(&mp->m_eofblocks_work, xfs_eofblocks_worker); in xfs_init_fs_context()
1835 INIT_DELAYED_WORK(&mp->m_cowblocks_work, xfs_cowblocks_worker); in xfs_init_fs_context()
1836 mp->m_kobj.kobject.kset = xfs_kset; in xfs_init_fs_context()
1843 mp->m_finobt_nores = true; in xfs_init_fs_context()
1848 mp->m_logbufs = -1; in xfs_init_fs_context()
1849 mp->m_logbsize = -1; in xfs_init_fs_context()
1850 mp->m_allocsize_log = 16; /* 64k */ in xfs_init_fs_context()
1856 mp->m_flags |= XFS_MOUNT_RDONLY; in xfs_init_fs_context()
1858 mp->m_flags |= XFS_MOUNT_DIRSYNC; in xfs_init_fs_context()
1860 mp->m_flags |= XFS_MOUNT_WSYNC; in xfs_init_fs_context()
1862 fc->s_fs_info = mp; in xfs_init_fs_context()