Lines Matching full:mp
60 struct xfs_mount *mp) in xfs_uuid_mount() argument
62 uuid_t *uuid = &mp->m_sb.sb_uuid; in xfs_uuid_mount()
66 super_set_uuid(mp->m_super, uuid->b, sizeof(*uuid)); in xfs_uuid_mount()
68 if (xfs_has_nouuid(mp)) in xfs_uuid_mount()
72 xfs_warn(mp, "Filesystem has null UUID - can't mount"); in xfs_uuid_mount()
99 xfs_warn(mp, "Filesystem has duplicate UUID %pU - can't mount", uuid); in xfs_uuid_mount()
105 struct xfs_mount *mp) in xfs_uuid_unmount() argument
107 uuid_t *uuid = &mp->m_sb.sb_uuid; in xfs_uuid_unmount()
110 if (xfs_has_nouuid(mp)) in xfs_uuid_unmount()
155 struct xfs_mount *mp, in xfs_readsb() argument
160 struct xfs_sb *sbp = &mp->m_sb; in xfs_readsb()
165 ASSERT(mp->m_sb_bp == NULL); in xfs_readsb()
166 ASSERT(mp->m_ddev_targp != NULL); in xfs_readsb()
175 sector_size = xfs_getsize_buftarg(mp->m_ddev_targp); in xfs_readsb()
185 error = xfs_buf_read_uncached(mp->m_ddev_targp, XFS_SB_DADDR, in xfs_readsb()
190 xfs_warn(mp, "SB validate failed with error %d.", error); in xfs_readsb()
208 xfs_warn(mp, "Invalid superblock magic number"); in xfs_readsb()
218 xfs_warn(mp, "device supports %u byte sectors (not %u)", in xfs_readsb()
235 mp->m_features |= xfs_sb_version_to_features(sbp); in xfs_readsb()
236 xfs_reinit_percpu_counters(mp); in xfs_readsb()
242 if (xfs_sb_version_haslogxattrs(&mp->m_sb)) in xfs_readsb()
243 xfs_set_using_logged_xattrs(mp); in xfs_readsb()
248 mp->m_sb_bp = bp; in xfs_readsb()
265 struct xfs_mount *mp, in xfs_check_new_dalign() argument
269 struct xfs_sb *sbp = &mp->m_sb; in xfs_check_new_dalign()
272 calc_ino = xfs_ialloc_calc_rootino(mp, new_dalign); in xfs_check_new_dalign()
273 trace_xfs_check_new_dalign(mp, new_dalign, calc_ino); in xfs_check_new_dalign()
280 xfs_warn(mp, in xfs_check_new_dalign()
288 xfs_warn(mp, "Skipping superblock stripe alignment update."); in xfs_check_new_dalign()
301 struct xfs_mount *mp) in xfs_validate_new_dalign() argument
303 if (mp->m_dalign == 0) in xfs_validate_new_dalign()
310 if ((BBTOB(mp->m_dalign) & mp->m_blockmask) || in xfs_validate_new_dalign()
311 (BBTOB(mp->m_swidth) & mp->m_blockmask)) { in xfs_validate_new_dalign()
312 xfs_warn(mp, in xfs_validate_new_dalign()
314 mp->m_sb.sb_blocksize); in xfs_validate_new_dalign()
321 mp->m_dalign = XFS_BB_TO_FSBT(mp, mp->m_dalign); in xfs_validate_new_dalign()
322 if (mp->m_dalign && (mp->m_sb.sb_agblocks % mp->m_dalign)) { in xfs_validate_new_dalign()
323 xfs_warn(mp, in xfs_validate_new_dalign()
325 mp->m_sb.sb_agblocks); in xfs_validate_new_dalign()
329 if (!mp->m_dalign) { in xfs_validate_new_dalign()
330 xfs_warn(mp, in xfs_validate_new_dalign()
332 mp->m_dalign, mp->m_sb.sb_blocksize); in xfs_validate_new_dalign()
336 mp->m_swidth = XFS_BB_TO_FSBT(mp, mp->m_swidth); in xfs_validate_new_dalign()
338 if (!xfs_has_dalign(mp)) { in xfs_validate_new_dalign()
339 xfs_warn(mp, in xfs_validate_new_dalign()
350 struct xfs_mount *mp) in xfs_update_alignment() argument
352 struct xfs_sb *sbp = &mp->m_sb; in xfs_update_alignment()
354 if (mp->m_dalign) { in xfs_update_alignment()
358 if (sbp->sb_unit == mp->m_dalign && in xfs_update_alignment()
359 sbp->sb_width == mp->m_swidth) in xfs_update_alignment()
362 error = xfs_check_new_dalign(mp, mp->m_dalign, &update_sb); in xfs_update_alignment()
366 sbp->sb_unit = mp->m_dalign; in xfs_update_alignment()
367 sbp->sb_width = mp->m_swidth; in xfs_update_alignment()
368 mp->m_update_sb = true; in xfs_update_alignment()
369 } else if (!xfs_has_noalign(mp) && xfs_has_dalign(mp)) { in xfs_update_alignment()
370 mp->m_dalign = sbp->sb_unit; in xfs_update_alignment()
371 mp->m_swidth = sbp->sb_width; in xfs_update_alignment()
382 struct xfs_mount *mp) in xfs_set_low_space_thresholds() argument
384 uint64_t dblocks = mp->m_sb.sb_dblocks; in xfs_set_low_space_thresholds()
385 uint64_t rtexts = mp->m_sb.sb_rextents; in xfs_set_low_space_thresholds()
392 mp->m_low_space[i] = dblocks * (i + 1); in xfs_set_low_space_thresholds()
393 mp->m_low_rtexts[i] = rtexts * (i + 1); in xfs_set_low_space_thresholds()
402 struct xfs_mount *mp) in xfs_check_sizes() argument
408 d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks); in xfs_check_sizes()
409 if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_dblocks) { in xfs_check_sizes()
410 xfs_warn(mp, "filesystem size mismatch detected"); in xfs_check_sizes()
413 error = xfs_buf_read_uncached(mp->m_ddev_targp, in xfs_check_sizes()
414 d - XFS_FSS_TO_BB(mp, 1), in xfs_check_sizes()
415 XFS_FSS_TO_BB(mp, 1), 0, &bp, NULL); in xfs_check_sizes()
417 xfs_warn(mp, "last sector read failed"); in xfs_check_sizes()
422 if (mp->m_logdev_targp == mp->m_ddev_targp) in xfs_check_sizes()
425 d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks); in xfs_check_sizes()
426 if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) { in xfs_check_sizes()
427 xfs_warn(mp, "log size mismatch detected"); in xfs_check_sizes()
430 error = xfs_buf_read_uncached(mp->m_logdev_targp, in xfs_check_sizes()
431 d - XFS_FSB_TO_BB(mp, 1), in xfs_check_sizes()
432 XFS_FSB_TO_BB(mp, 1), 0, &bp, NULL); in xfs_check_sizes()
434 xfs_warn(mp, "log device read failed"); in xfs_check_sizes()
446 struct xfs_mount *mp) in xfs_mount_reset_sbqflags() argument
448 mp->m_qflags = 0; in xfs_mount_reset_sbqflags()
451 if (mp->m_sb.sb_qflags == 0) in xfs_mount_reset_sbqflags()
453 spin_lock(&mp->m_sb_lock); in xfs_mount_reset_sbqflags()
454 mp->m_sb.sb_qflags = 0; in xfs_mount_reset_sbqflags()
455 spin_unlock(&mp->m_sb_lock); in xfs_mount_reset_sbqflags()
457 if (!xfs_fs_writable(mp, SB_FREEZE_WRITE)) in xfs_mount_reset_sbqflags()
460 return xfs_sync_sb(mp, false); in xfs_mount_reset_sbqflags()
464 xfs_default_resblks(xfs_mount_t *mp) in xfs_default_resblks() argument
475 resblks = mp->m_sb.sb_dblocks; in xfs_default_resblks()
484 struct xfs_mount *mp) in xfs_check_summary_counts() argument
492 if (mp->m_sb.sb_inprogress) { in xfs_check_summary_counts()
493 xfs_err(mp, "sb_inprogress set after log recovery??"); in xfs_check_summary_counts()
509 if (xfs_is_clean(mp) && in xfs_check_summary_counts()
510 (mp->m_sb.sb_fdblocks > mp->m_sb.sb_dblocks || in xfs_check_summary_counts()
511 !xfs_verify_icount(mp, mp->m_sb.sb_icount) || in xfs_check_summary_counts()
512 mp->m_sb.sb_ifree > mp->m_sb.sb_icount)) in xfs_check_summary_counts()
513 xfs_fs_mark_sick(mp, XFS_SICK_FS_COUNTERS); in xfs_check_summary_counts()
526 if ((xfs_has_lazysbcount(mp) && !xfs_is_clean(mp)) || in xfs_check_summary_counts()
527 xfs_fs_has_sickness(mp, XFS_SICK_FS_COUNTERS)) { in xfs_check_summary_counts()
528 error = xfs_initialize_perag_data(mp, mp->m_sb.sb_agcount); in xfs_check_summary_counts()
545 if (xfs_has_realtime(mp) && !xfs_is_clean(mp)) { in xfs_check_summary_counts()
546 error = xfs_rtalloc_reinit_frextents(mp); in xfs_check_summary_counts()
556 struct xfs_mount *mp) in xfs_unmount_check() argument
558 if (xfs_is_shutdown(mp)) in xfs_unmount_check()
561 if (percpu_counter_sum(&mp->m_ifree) > in xfs_unmount_check()
562 percpu_counter_sum(&mp->m_icount)) { in xfs_unmount_check()
563 xfs_alert(mp, "ifree/icount mismatch at unmount"); in xfs_unmount_check()
564 xfs_fs_mark_sick(mp, XFS_SICK_FS_COUNTERS); in xfs_unmount_check()
596 struct xfs_mount *mp) in xfs_unmount_flush_inodes() argument
598 xfs_log_force(mp, XFS_LOG_SYNC); in xfs_unmount_flush_inodes()
599 xfs_extent_busy_wait_all(mp); in xfs_unmount_flush_inodes()
602 xfs_set_unmounting(mp); in xfs_unmount_flush_inodes()
604 xfs_ail_push_all_sync(mp->m_ail); in xfs_unmount_flush_inodes()
605 xfs_inodegc_stop(mp); in xfs_unmount_flush_inodes()
606 cancel_delayed_work_sync(&mp->m_reclaim_work); in xfs_unmount_flush_inodes()
607 xfs_reclaim_inodes(mp); in xfs_unmount_flush_inodes()
608 xfs_health_unmount(mp); in xfs_unmount_flush_inodes()
613 struct xfs_mount *mp) in xfs_mount_setup_inode_geom() argument
615 struct xfs_ino_geometry *igeo = M_IGEO(mp); in xfs_mount_setup_inode_geom()
617 igeo->attr_fork_offset = xfs_bmap_compute_attr_offset(mp); in xfs_mount_setup_inode_geom()
618 ASSERT(igeo->attr_fork_offset < XFS_LITINO(mp)); in xfs_mount_setup_inode_geom()
620 xfs_ialloc_setup_geometry(mp); in xfs_mount_setup_inode_geom()
626 struct xfs_mount *mp) in xfs_agbtree_compute_maxlevels() argument
630 levels = max(mp->m_alloc_maxlevels, M_IGEO(mp)->inobt_maxlevels); in xfs_agbtree_compute_maxlevels()
631 levels = max(levels, mp->m_rmap_maxlevels); in xfs_agbtree_compute_maxlevels()
632 mp->m_agbtree_maxlevels = max(levels, mp->m_refc_maxlevels); in xfs_agbtree_compute_maxlevels()
647 struct xfs_mount *mp) in xfs_mountfs() argument
649 struct xfs_sb *sbp = &(mp->m_sb); in xfs_mountfs()
651 struct xfs_ino_geometry *igeo = M_IGEO(mp); in xfs_mountfs()
656 xfs_sb_mount_common(mp, sbp); in xfs_mountfs()
675 xfs_warn(mp, "correcting sb_features alignment problem"); in xfs_mountfs()
677 mp->m_update_sb = true; in xfs_mountfs()
682 if (!(mp->m_sb.sb_versionnum & XFS_SB_VERSION_NLINKBIT)) { in xfs_mountfs()
683 mp->m_sb.sb_versionnum |= XFS_SB_VERSION_NLINKBIT; in xfs_mountfs()
684 mp->m_features |= XFS_FEAT_NLINK; in xfs_mountfs()
685 mp->m_update_sb = true; in xfs_mountfs()
694 error = xfs_validate_new_dalign(mp); in xfs_mountfs()
698 xfs_alloc_compute_maxlevels(mp); in xfs_mountfs()
699 xfs_bmap_compute_maxlevels(mp, XFS_DATA_FORK); in xfs_mountfs()
700 xfs_bmap_compute_maxlevels(mp, XFS_ATTR_FORK); in xfs_mountfs()
701 xfs_mount_setup_inode_geom(mp); in xfs_mountfs()
702 xfs_rmapbt_compute_maxlevels(mp); in xfs_mountfs()
703 xfs_refcountbt_compute_maxlevels(mp); in xfs_mountfs()
705 xfs_agbtree_compute_maxlevels(mp); in xfs_mountfs()
714 error = xfs_update_alignment(mp); in xfs_mountfs()
719 mp->m_fail_unmount = true; in xfs_mountfs()
721 super_set_sysfs_name_id(mp->m_super); in xfs_mountfs()
723 error = xfs_sysfs_init(&mp->m_kobj, &xfs_mp_ktype, in xfs_mountfs()
724 NULL, mp->m_super->s_id); in xfs_mountfs()
728 error = xfs_sysfs_init(&mp->m_stats.xs_kobj, &xfs_stats_ktype, in xfs_mountfs()
729 &mp->m_kobj, "stats"); in xfs_mountfs()
733 xchk_stats_register(mp->m_scrub_stats, mp->m_debugfs); in xfs_mountfs()
735 error = xfs_error_sysfs_init(mp); in xfs_mountfs()
739 error = xfs_errortag_init(mp); in xfs_mountfs()
743 error = xfs_uuid_mount(mp); in xfs_mountfs()
751 mp->m_allocsize_log = in xfs_mountfs()
752 max_t(uint32_t, sbp->sb_blocklog, mp->m_allocsize_log); in xfs_mountfs()
753 mp->m_allocsize_blocks = 1U << (mp->m_allocsize_log - sbp->sb_blocklog); in xfs_mountfs()
756 xfs_set_low_space_thresholds(mp); in xfs_mountfs()
763 if (xfs_has_sparseinodes(mp) && in xfs_mountfs()
764 mp->m_sb.sb_spino_align != in xfs_mountfs()
765 XFS_B_TO_FSBT(mp, igeo->inode_cluster_size_raw)) { in xfs_mountfs()
766 xfs_warn(mp, in xfs_mountfs()
768 mp->m_sb.sb_spino_align, in xfs_mountfs()
769 XFS_B_TO_FSBT(mp, igeo->inode_cluster_size_raw)); in xfs_mountfs()
777 error = xfs_check_sizes(mp); in xfs_mountfs()
784 error = xfs_rtmount_init(mp); in xfs_mountfs()
786 xfs_warn(mp, "RT mount failed"); in xfs_mountfs()
794 mp->m_fixedfsid[0] = in xfs_mountfs()
797 mp->m_fixedfsid[1] = get_unaligned_be32(&sbp->sb_uuid.b[0]); in xfs_mountfs()
799 error = xfs_da_mount(mp); in xfs_mountfs()
801 xfs_warn(mp, "Failed dir/attr init: %d", error); in xfs_mountfs()
808 xfs_trans_init(mp); in xfs_mountfs()
813 error = xfs_initialize_perag(mp, 0, sbp->sb_agcount, in xfs_mountfs()
814 mp->m_sb.sb_dblocks, &mp->m_maxagi); in xfs_mountfs()
816 xfs_warn(mp, "Failed per-ag init: %d", error); in xfs_mountfs()
820 if (XFS_IS_CORRUPT(mp, !sbp->sb_logblocks)) { in xfs_mountfs()
821 xfs_warn(mp, "no log defined"); in xfs_mountfs()
826 error = xfs_inodegc_register_shrinker(mp); in xfs_mountfs()
835 error = xfs_log_mount(mp, mp->m_logdev_targp, in xfs_mountfs()
836 XFS_FSB_TO_DADDR(mp, sbp->sb_logstart), in xfs_mountfs()
837 XFS_FSB_TO_BB(mp, sbp->sb_logblocks)); in xfs_mountfs()
839 xfs_warn(mp, "log mount failed"); in xfs_mountfs()
847 if (xfs_sb_version_haslogxattrs(&mp->m_sb)) in xfs_mountfs()
848 xfs_set_using_logged_xattrs(mp); in xfs_mountfs()
850 xfs_clear_using_logged_xattrs(mp); in xfs_mountfs()
853 xfs_inodegc_start(mp); in xfs_mountfs()
854 xfs_blockgc_start(mp); in xfs_mountfs()
862 if (xfs_has_noattr2(mp)) { in xfs_mountfs()
863 mp->m_features &= ~XFS_FEAT_ATTR2; in xfs_mountfs()
864 } else if (!xfs_has_attr2(mp) && in xfs_mountfs()
865 (mp->m_sb.sb_features2 & XFS_SB_VERSION2_ATTR2BIT)) { in xfs_mountfs()
866 mp->m_features |= XFS_FEAT_ATTR2; in xfs_mountfs()
873 error = xfs_iget(mp, NULL, sbp->sb_rootino, XFS_IGET_UNTRUSTED, in xfs_mountfs()
876 xfs_warn(mp, in xfs_mountfs()
884 if (XFS_IS_CORRUPT(mp, !S_ISDIR(VFS_I(rip)->i_mode))) { in xfs_mountfs()
885 xfs_warn(mp, "corrupted root inode %llu: not a directory", in xfs_mountfs()
891 mp->m_rootip = rip; /* save it */ in xfs_mountfs()
898 error = xfs_rtmount_inodes(mp); in xfs_mountfs()
903 xfs_warn(mp, "failed to read RT inodes"); in xfs_mountfs()
908 error = xfs_check_summary_counts(mp); in xfs_mountfs()
917 if (mp->m_update_sb && !xfs_is_readonly(mp)) { in xfs_mountfs()
918 error = xfs_sync_sb(mp, false); in xfs_mountfs()
920 xfs_warn(mp, "failed to write sb changes"); in xfs_mountfs()
928 if (XFS_IS_QUOTA_ON(mp)) { in xfs_mountfs()
929 error = xfs_qm_newmount(mp, "amount, "aflags); in xfs_mountfs()
938 if (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_ACCT) { in xfs_mountfs()
939 xfs_notice(mp, "resetting quota flags"); in xfs_mountfs()
940 error = xfs_mount_reset_sbqflags(mp); in xfs_mountfs()
954 error = xfs_fs_reserve_ag_blocks(mp); in xfs_mountfs()
956 xfs_warn(mp, in xfs_mountfs()
958 error = xfs_log_mount_finish(mp); in xfs_mountfs()
959 xfs_fs_unreserve_ag_blocks(mp); in xfs_mountfs()
961 xfs_warn(mp, "log mount finish failed"); in xfs_mountfs()
974 if (xfs_is_readonly(mp) && !xfs_has_norecovery(mp)) in xfs_mountfs()
975 xfs_log_clean(mp); in xfs_mountfs()
981 ASSERT(mp->m_qflags == 0); in xfs_mountfs()
982 mp->m_qflags = quotaflags; in xfs_mountfs()
984 xfs_qm_mount_quotas(mp); in xfs_mountfs()
998 if (!xfs_is_readonly(mp)) { in xfs_mountfs()
999 error = xfs_reserve_blocks(mp, xfs_default_resblks(mp)); in xfs_mountfs()
1001 xfs_warn(mp, in xfs_mountfs()
1005 error = xfs_fs_reserve_ag_blocks(mp); in xfs_mountfs()
1013 xfs_fs_unreserve_ag_blocks(mp); in xfs_mountfs()
1014 xfs_qm_unmount_quotas(mp); in xfs_mountfs()
1016 xfs_rtunmount_inodes(mp); in xfs_mountfs()
1020 xfs_qm_unmount(mp); in xfs_mountfs()
1028 xfs_inodegc_flush(mp); in xfs_mountfs()
1041 xfs_unmount_flush_inodes(mp); in xfs_mountfs()
1043 xfs_log_mount_cancel(mp); in xfs_mountfs()
1045 shrinker_free(mp->m_inodegc_shrinker); in xfs_mountfs()
1047 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) in xfs_mountfs()
1048 xfs_buftarg_drain(mp->m_logdev_targp); in xfs_mountfs()
1049 xfs_buftarg_drain(mp->m_ddev_targp); in xfs_mountfs()
1051 xfs_free_perag_range(mp, 0, mp->m_sb.sb_agcount); in xfs_mountfs()
1053 xfs_da_unmount(mp); in xfs_mountfs()
1055 xfs_uuid_unmount(mp); in xfs_mountfs()
1057 xfs_errortag_del(mp); in xfs_mountfs()
1059 xfs_error_sysfs_del(mp); in xfs_mountfs()
1061 xchk_stats_unregister(mp->m_scrub_stats); in xfs_mountfs()
1062 xfs_sysfs_del(&mp->m_stats.xs_kobj); in xfs_mountfs()
1064 xfs_sysfs_del(&mp->m_kobj); in xfs_mountfs()
1075 struct xfs_mount *mp) in xfs_unmountfs() argument
1087 xfs_inodegc_flush(mp); in xfs_unmountfs()
1089 xfs_blockgc_stop(mp); in xfs_unmountfs()
1090 xfs_fs_unreserve_ag_blocks(mp); in xfs_unmountfs()
1091 xfs_qm_unmount_quotas(mp); in xfs_unmountfs()
1092 xfs_rtunmount_inodes(mp); in xfs_unmountfs()
1093 xfs_irele(mp->m_rootip); in xfs_unmountfs()
1095 xfs_unmount_flush_inodes(mp); in xfs_unmountfs()
1097 xfs_qm_unmount(mp); in xfs_unmountfs()
1113 error = xfs_reserve_blocks(mp, 0); in xfs_unmountfs()
1115 xfs_warn(mp, "Unable to free reserved block pool. " in xfs_unmountfs()
1117 xfs_unmount_check(mp); in xfs_unmountfs()
1123 xfs_set_done_with_log_incompat(mp); in xfs_unmountfs()
1124 xfs_log_unmount(mp); in xfs_unmountfs()
1125 xfs_da_unmount(mp); in xfs_unmountfs()
1126 xfs_uuid_unmount(mp); in xfs_unmountfs()
1129 xfs_errortag_clearall(mp); in xfs_unmountfs()
1131 shrinker_free(mp->m_inodegc_shrinker); in xfs_unmountfs()
1132 xfs_free_perag_range(mp, 0, mp->m_sb.sb_agcount); in xfs_unmountfs()
1133 xfs_errortag_del(mp); in xfs_unmountfs()
1134 xfs_error_sysfs_del(mp); in xfs_unmountfs()
1135 xchk_stats_unregister(mp->m_scrub_stats); in xfs_unmountfs()
1136 xfs_sysfs_del(&mp->m_stats.xs_kobj); in xfs_unmountfs()
1137 xfs_sysfs_del(&mp->m_kobj); in xfs_unmountfs()
1148 struct xfs_mount *mp, in xfs_fs_writable() argument
1152 if ((mp->m_super->s_writers.frozen >= level) || in xfs_fs_writable()
1153 xfs_is_shutdown(mp) || xfs_is_readonly(mp)) in xfs_fs_writable()
1161 struct xfs_mount *mp, in xfs_add_freecounter() argument
1165 bool has_resv_pool = (counter == &mp->m_fdblocks); in xfs_add_freecounter()
1172 if (!has_resv_pool || mp->m_resblks == mp->m_resblks_avail) { in xfs_add_freecounter()
1177 spin_lock(&mp->m_sb_lock); in xfs_add_freecounter()
1178 res_used = mp->m_resblks - mp->m_resblks_avail; in xfs_add_freecounter()
1180 mp->m_resblks_avail += delta; in xfs_add_freecounter()
1183 mp->m_resblks_avail = mp->m_resblks; in xfs_add_freecounter()
1186 spin_unlock(&mp->m_sb_lock); in xfs_add_freecounter()
1191 struct xfs_mount *mp, in xfs_dec_freecounter() argument
1201 ASSERT(counter == &mp->m_fdblocks || counter == &mp->m_frextents); in xfs_dec_freecounter()
1202 has_resv_pool = (counter == &mp->m_fdblocks); in xfs_dec_freecounter()
1232 set_aside = xfs_fdblocks_unavailable(mp); in xfs_dec_freecounter()
1244 spin_lock(&mp->m_sb_lock); in xfs_dec_freecounter()
1249 lcounter = (long long)mp->m_resblks_avail - delta; in xfs_dec_freecounter()
1251 mp->m_resblks_avail = lcounter; in xfs_dec_freecounter()
1252 spin_unlock(&mp->m_sb_lock); in xfs_dec_freecounter()
1255 xfs_warn_once(mp, in xfs_dec_freecounter()
1259 spin_unlock(&mp->m_sb_lock); in xfs_dec_freecounter()
1268 struct xfs_mount *mp) in xfs_freesb() argument
1270 struct xfs_buf *bp = mp->m_sb_bp; in xfs_freesb()
1273 mp->m_sb_bp = NULL; in xfs_freesb()
1283 struct xfs_mount *mp, in xfs_dev_is_read_only() argument
1286 if (xfs_readonly_buftarg(mp->m_ddev_targp) || in xfs_dev_is_read_only()
1287 xfs_readonly_buftarg(mp->m_logdev_targp) || in xfs_dev_is_read_only()
1288 (mp->m_rtdev_targp && xfs_readonly_buftarg(mp->m_rtdev_targp))) { in xfs_dev_is_read_only()
1289 xfs_notice(mp, "%s required on read-only device.", message); in xfs_dev_is_read_only()
1290 xfs_notice(mp, "write access unavailable, cannot proceed."); in xfs_dev_is_read_only()
1299 struct xfs_mount *mp) in xfs_force_summary_recalc() argument
1301 if (!xfs_has_lazysbcount(mp)) in xfs_force_summary_recalc()
1304 xfs_fs_mark_sick(mp, XFS_SICK_FS_COUNTERS); in xfs_force_summary_recalc()
1313 struct xfs_mount *mp, in xfs_add_incompat_log_feature() argument
1328 error = xfs_log_force(mp, XFS_LOG_SYNC); in xfs_add_incompat_log_feature()
1331 xfs_ail_push_all(mp->m_ail); in xfs_add_incompat_log_feature()
1337 xfs_buf_lock(mp->m_sb_bp); in xfs_add_incompat_log_feature()
1338 xfs_buf_hold(mp->m_sb_bp); in xfs_add_incompat_log_feature()
1340 if (xfs_is_shutdown(mp)) { in xfs_add_incompat_log_feature()
1345 if (xfs_sb_has_incompat_log_feature(&mp->m_sb, feature)) in xfs_add_incompat_log_feature()
1353 dsb = mp->m_sb_bp->b_addr; in xfs_add_incompat_log_feature()
1354 xfs_sb_to_disk(dsb, &mp->m_sb); in xfs_add_incompat_log_feature()
1356 error = xfs_bwrite(mp->m_sb_bp); in xfs_add_incompat_log_feature()
1364 xfs_sb_add_incompat_log_features(&mp->m_sb, feature); in xfs_add_incompat_log_feature()
1365 xfs_buf_relse(mp->m_sb_bp); in xfs_add_incompat_log_feature()
1368 return xfs_sync_sb(mp, false); in xfs_add_incompat_log_feature()
1370 xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR); in xfs_add_incompat_log_feature()
1372 xfs_buf_relse(mp->m_sb_bp); in xfs_add_incompat_log_feature()
1388 struct xfs_mount *mp) in xfs_clear_incompat_log_features() argument
1392 if (!xfs_has_crc(mp) || in xfs_clear_incompat_log_features()
1393 !xfs_sb_has_incompat_log_feature(&mp->m_sb, in xfs_clear_incompat_log_features()
1395 xfs_is_shutdown(mp) || in xfs_clear_incompat_log_features()
1396 !xfs_is_done_with_log_incompat(mp)) in xfs_clear_incompat_log_features()
1404 xfs_buf_lock(mp->m_sb_bp); in xfs_clear_incompat_log_features()
1405 xfs_buf_hold(mp->m_sb_bp); in xfs_clear_incompat_log_features()
1407 if (xfs_sb_has_incompat_log_feature(&mp->m_sb, in xfs_clear_incompat_log_features()
1409 xfs_sb_remove_incompat_log_features(&mp->m_sb); in xfs_clear_incompat_log_features()
1413 xfs_buf_relse(mp->m_sb_bp); in xfs_clear_incompat_log_features()
1435 struct xfs_mount *mp = ip->i_mount; in xfs_mod_delalloc() local
1438 percpu_counter_add_batch(&mp->m_delalloc_rtextents, in xfs_mod_delalloc()
1439 xfs_rtb_to_rtx(mp, data_delta), in xfs_mod_delalloc()
1445 percpu_counter_add_batch(&mp->m_delalloc_blks, data_delta + ind_delta, in xfs_mod_delalloc()