Lines Matching refs:mp
190 struct xfs_mount *mp, in xfs_parseargs() argument
193 const struct super_block *sb = mp->m_super; in xfs_parseargs()
205 mp->m_fsname = kstrndup(sb->s_id, MAXNAMELEN, GFP_KERNEL); in xfs_parseargs()
206 if (!mp->m_fsname) in xfs_parseargs()
208 mp->m_fsname_len = strlen(mp->m_fsname) + 1; in xfs_parseargs()
214 mp->m_flags |= XFS_MOUNT_RDONLY; in xfs_parseargs()
216 mp->m_flags |= XFS_MOUNT_DIRSYNC; in xfs_parseargs()
218 mp->m_flags |= XFS_MOUNT_WSYNC; in xfs_parseargs()
224 mp->m_flags |= XFS_MOUNT_BARRIER; in xfs_parseargs()
225 mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; in xfs_parseargs()
230 mp->m_logbufs = -1; in xfs_parseargs()
231 mp->m_logbsize = -1; in xfs_parseargs()
245 if (match_int(args, &mp->m_logbufs)) in xfs_parseargs()
249 if (suffix_kstrtoint(args, 10, &mp->m_logbsize)) in xfs_parseargs()
253 mp->m_logname = match_strdup(args); in xfs_parseargs()
254 if (!mp->m_logname) in xfs_parseargs()
258 xfs_warn(mp, "%s option not allowed on this system", p); in xfs_parseargs()
261 mp->m_rtname = match_strdup(args); in xfs_parseargs()
262 if (!mp->m_rtname) in xfs_parseargs()
273 mp->m_flags |= XFS_MOUNT_GRPID; in xfs_parseargs()
277 mp->m_flags &= ~XFS_MOUNT_GRPID; in xfs_parseargs()
280 mp->m_flags |= XFS_MOUNT_WSYNC; in xfs_parseargs()
283 mp->m_flags |= XFS_MOUNT_NORECOVERY; in xfs_parseargs()
286 mp->m_flags |= XFS_MOUNT_NOALIGN; in xfs_parseargs()
289 mp->m_flags |= XFS_MOUNT_SWALLOC; in xfs_parseargs()
300 mp->m_flags |= XFS_MOUNT_SMALL_INUMS; in xfs_parseargs()
303 mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; in xfs_parseargs()
306 mp->m_flags |= XFS_MOUNT_NOUUID; in xfs_parseargs()
309 mp->m_flags |= XFS_MOUNT_IKEEP; in xfs_parseargs()
312 mp->m_flags &= ~XFS_MOUNT_IKEEP; in xfs_parseargs()
315 mp->m_flags &= ~XFS_MOUNT_COMPAT_IOSIZE; in xfs_parseargs()
318 mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; in xfs_parseargs()
321 mp->m_flags |= XFS_MOUNT_ATTR2; in xfs_parseargs()
324 mp->m_flags &= ~XFS_MOUNT_ATTR2; in xfs_parseargs()
325 mp->m_flags |= XFS_MOUNT_NOATTR2; in xfs_parseargs()
328 mp->m_flags |= XFS_MOUNT_FILESTREAMS; in xfs_parseargs()
331 mp->m_qflags &= ~XFS_ALL_QUOTA_ACCT; in xfs_parseargs()
332 mp->m_qflags &= ~XFS_ALL_QUOTA_ENFD; in xfs_parseargs()
333 mp->m_qflags &= ~XFS_ALL_QUOTA_ACTIVE; in xfs_parseargs()
338 mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | in xfs_parseargs()
343 mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE); in xfs_parseargs()
344 mp->m_qflags &= ~XFS_UQUOTA_ENFD; in xfs_parseargs()
348 mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | in xfs_parseargs()
352 mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); in xfs_parseargs()
353 mp->m_qflags &= ~XFS_PQUOTA_ENFD; in xfs_parseargs()
357 mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | in xfs_parseargs()
361 mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); in xfs_parseargs()
362 mp->m_qflags &= ~XFS_GQUOTA_ENFD; in xfs_parseargs()
365 mp->m_flags |= XFS_MOUNT_DISCARD; in xfs_parseargs()
368 mp->m_flags &= ~XFS_MOUNT_DISCARD; in xfs_parseargs()
372 mp->m_flags |= XFS_MOUNT_DAX; in xfs_parseargs()
376 xfs_warn(mp, "%s option is deprecated, ignoring.", p); in xfs_parseargs()
377 mp->m_flags |= XFS_MOUNT_BARRIER; in xfs_parseargs()
380 xfs_warn(mp, "%s option is deprecated, ignoring.", p); in xfs_parseargs()
381 mp->m_flags &= ~XFS_MOUNT_BARRIER; in xfs_parseargs()
384 xfs_warn(mp, "unknown mount option [%s].", p); in xfs_parseargs()
392 if ((mp->m_flags & XFS_MOUNT_NORECOVERY) && in xfs_parseargs()
393 !(mp->m_flags & XFS_MOUNT_RDONLY)) { in xfs_parseargs()
394 xfs_warn(mp, "no-recovery mounts must be read-only."); in xfs_parseargs()
398 if ((mp->m_flags & XFS_MOUNT_NOALIGN) && (dsunit || dswidth)) { in xfs_parseargs()
399 xfs_warn(mp, in xfs_parseargs()
405 if (XFS_IS_QUOTA_RUNNING(mp)) { in xfs_parseargs()
406 xfs_warn(mp, "quota support not available in this kernel."); in xfs_parseargs()
412 xfs_warn(mp, "sunit and swidth must be specified together"); in xfs_parseargs()
417 xfs_warn(mp, in xfs_parseargs()
424 if (dsunit && !(mp->m_flags & XFS_MOUNT_NOALIGN)) { in xfs_parseargs()
431 mp->m_dalign = dsunit; in xfs_parseargs()
432 mp->m_swidth = dswidth; in xfs_parseargs()
435 if (mp->m_logbufs != -1 && in xfs_parseargs()
436 mp->m_logbufs != 0 && in xfs_parseargs()
437 (mp->m_logbufs < XLOG_MIN_ICLOGS || in xfs_parseargs()
438 mp->m_logbufs > XLOG_MAX_ICLOGS)) { in xfs_parseargs()
439 xfs_warn(mp, "invalid logbufs value: %d [not %d-%d]", in xfs_parseargs()
440 mp->m_logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS); in xfs_parseargs()
443 if (mp->m_logbsize != -1 && in xfs_parseargs()
444 mp->m_logbsize != 0 && in xfs_parseargs()
445 (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE || in xfs_parseargs()
446 mp->m_logbsize > XLOG_MAX_RECORD_BSIZE || in xfs_parseargs()
447 !is_power_of_2(mp->m_logbsize))) { in xfs_parseargs()
448 xfs_warn(mp, in xfs_parseargs()
450 mp->m_logbsize); in xfs_parseargs()
457 xfs_warn(mp, "invalid log iosize: %d [not %d-%d]", in xfs_parseargs()
463 mp->m_flags |= XFS_MOUNT_DFLT_IOSIZE; in xfs_parseargs()
464 mp->m_readio_log = iosizelog; in xfs_parseargs()
465 mp->m_writeio_log = iosizelog; in xfs_parseargs()
478 struct xfs_mount *mp, in xfs_showargs() argument
507 if (mp->m_flags & xfs_infop->flag) in xfs_showargs()
511 if (!(mp->m_flags & xfs_infop->flag)) in xfs_showargs()
515 if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) in xfs_showargs()
517 (int)(1 << mp->m_writeio_log) >> 10); in xfs_showargs()
519 if (mp->m_logbufs > 0) in xfs_showargs()
520 seq_printf(m, ",logbufs=%d", mp->m_logbufs); in xfs_showargs()
521 if (mp->m_logbsize > 0) in xfs_showargs()
522 seq_printf(m, ",logbsize=%dk", mp->m_logbsize >> 10); in xfs_showargs()
524 if (mp->m_logname) in xfs_showargs()
525 seq_show_option(m, "logdev", mp->m_logname); in xfs_showargs()
526 if (mp->m_rtname) in xfs_showargs()
527 seq_show_option(m, "rtdev", mp->m_rtname); in xfs_showargs()
529 if (mp->m_dalign > 0) in xfs_showargs()
531 (int)XFS_FSB_TO_BB(mp, mp->m_dalign)); in xfs_showargs()
532 if (mp->m_swidth > 0) in xfs_showargs()
534 (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); in xfs_showargs()
536 if (mp->m_qflags & (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD)) in xfs_showargs()
538 else if (mp->m_qflags & XFS_UQUOTA_ACCT) in xfs_showargs()
541 if (mp->m_qflags & XFS_PQUOTA_ACCT) { in xfs_showargs()
542 if (mp->m_qflags & XFS_PQUOTA_ENFD) in xfs_showargs()
547 if (mp->m_qflags & XFS_GQUOTA_ACCT) { in xfs_showargs()
548 if (mp->m_qflags & XFS_GQUOTA_ENFD) in xfs_showargs()
554 if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) in xfs_showargs()
610 struct xfs_mount *mp, in xfs_set_inode_alloc() argument
615 xfs_sb_t *sbp = &mp->m_sb; in xfs_set_inode_alloc()
624 if (mp->m_maxicount) { in xfs_set_inode_alloc()
637 agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks - 1, 0); in xfs_set_inode_alloc()
638 ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino); in xfs_set_inode_alloc()
645 if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) && ino > XFS_MAXINUMBER_32) in xfs_set_inode_alloc()
646 mp->m_flags |= XFS_MOUNT_32BITINODES; in xfs_set_inode_alloc()
648 mp->m_flags &= ~XFS_MOUNT_32BITINODES; in xfs_set_inode_alloc()
653 ino = XFS_AGINO_TO_INO(mp, index, agino); in xfs_set_inode_alloc()
655 pag = xfs_perag_get(mp, index); in xfs_set_inode_alloc()
657 if (mp->m_flags & XFS_MOUNT_32BITINODES) { in xfs_set_inode_alloc()
677 return (mp->m_flags & XFS_MOUNT_32BITINODES) ? maxagi : agcount; in xfs_set_inode_alloc()
682 xfs_mount_t *mp, in xfs_blkdev_get() argument
689 mp); in xfs_blkdev_get()
692 xfs_warn(mp, "Invalid device [%s], error=%d", name, error); in xfs_blkdev_get()
715 struct xfs_mount *mp) in xfs_close_devices() argument
717 struct dax_device *dax_ddev = mp->m_ddev_targp->bt_daxdev; in xfs_close_devices()
719 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { in xfs_close_devices()
720 struct block_device *logdev = mp->m_logdev_targp->bt_bdev; in xfs_close_devices()
721 struct dax_device *dax_logdev = mp->m_logdev_targp->bt_daxdev; in xfs_close_devices()
723 xfs_free_buftarg(mp, mp->m_logdev_targp); in xfs_close_devices()
727 if (mp->m_rtdev_targp) { in xfs_close_devices()
728 struct block_device *rtdev = mp->m_rtdev_targp->bt_bdev; in xfs_close_devices()
729 struct dax_device *dax_rtdev = mp->m_rtdev_targp->bt_daxdev; in xfs_close_devices()
731 xfs_free_buftarg(mp, mp->m_rtdev_targp); in xfs_close_devices()
735 xfs_free_buftarg(mp, mp->m_ddev_targp); in xfs_close_devices()
751 struct xfs_mount *mp) in xfs_open_devices() argument
753 struct block_device *ddev = mp->m_super->s_bdev; in xfs_open_devices()
762 if (mp->m_logname) { in xfs_open_devices()
763 error = xfs_blkdev_get(mp, mp->m_logname, &logdev); in xfs_open_devices()
769 if (mp->m_rtname) { in xfs_open_devices()
770 error = xfs_blkdev_get(mp, mp->m_rtname, &rtdev); in xfs_open_devices()
775 xfs_warn(mp, in xfs_open_devices()
787 mp->m_ddev_targp = xfs_alloc_buftarg(mp, ddev, dax_ddev); in xfs_open_devices()
788 if (!mp->m_ddev_targp) in xfs_open_devices()
792 mp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev, dax_rtdev); in xfs_open_devices()
793 if (!mp->m_rtdev_targp) in xfs_open_devices()
798 mp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev, dax_logdev); in xfs_open_devices()
799 if (!mp->m_logdev_targp) in xfs_open_devices()
802 mp->m_logdev_targp = mp->m_ddev_targp; in xfs_open_devices()
808 if (mp->m_rtdev_targp) in xfs_open_devices()
809 xfs_free_buftarg(mp, mp->m_rtdev_targp); in xfs_open_devices()
811 xfs_free_buftarg(mp, mp->m_ddev_targp); in xfs_open_devices()
830 struct xfs_mount *mp) in xfs_setup_devices() argument
834 error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_sectsize); in xfs_setup_devices()
838 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { in xfs_setup_devices()
841 if (xfs_sb_version_hassector(&mp->m_sb)) in xfs_setup_devices()
842 log_sector_size = mp->m_sb.sb_logsectsize; in xfs_setup_devices()
843 error = xfs_setsize_buftarg(mp->m_logdev_targp, in xfs_setup_devices()
848 if (mp->m_rtdev_targp) { in xfs_setup_devices()
849 error = xfs_setsize_buftarg(mp->m_rtdev_targp, in xfs_setup_devices()
850 mp->m_sb.sb_sectsize); in xfs_setup_devices()
860 struct xfs_mount *mp) in xfs_init_mount_workqueues() argument
862 mp->m_buf_workqueue = alloc_workqueue("xfs-buf/%s", in xfs_init_mount_workqueues()
863 WQ_MEM_RECLAIM|WQ_FREEZABLE, 1, mp->m_fsname); in xfs_init_mount_workqueues()
864 if (!mp->m_buf_workqueue) in xfs_init_mount_workqueues()
867 mp->m_data_workqueue = alloc_workqueue("xfs-data/%s", in xfs_init_mount_workqueues()
868 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); in xfs_init_mount_workqueues()
869 if (!mp->m_data_workqueue) in xfs_init_mount_workqueues()
872 mp->m_unwritten_workqueue = alloc_workqueue("xfs-conv/%s", in xfs_init_mount_workqueues()
873 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); in xfs_init_mount_workqueues()
874 if (!mp->m_unwritten_workqueue) in xfs_init_mount_workqueues()
877 mp->m_cil_workqueue = alloc_workqueue("xfs-cil/%s", in xfs_init_mount_workqueues()
878 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); in xfs_init_mount_workqueues()
879 if (!mp->m_cil_workqueue) in xfs_init_mount_workqueues()
882 mp->m_reclaim_workqueue = alloc_workqueue("xfs-reclaim/%s", in xfs_init_mount_workqueues()
883 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); in xfs_init_mount_workqueues()
884 if (!mp->m_reclaim_workqueue) in xfs_init_mount_workqueues()
887 mp->m_log_workqueue = alloc_workqueue("xfs-log/%s", in xfs_init_mount_workqueues()
889 mp->m_fsname); in xfs_init_mount_workqueues()
890 if (!mp->m_log_workqueue) in xfs_init_mount_workqueues()
893 mp->m_eofblocks_workqueue = alloc_workqueue("xfs-eofblocks/%s", in xfs_init_mount_workqueues()
894 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); in xfs_init_mount_workqueues()
895 if (!mp->m_eofblocks_workqueue) in xfs_init_mount_workqueues()
898 mp->m_sync_workqueue = alloc_workqueue("xfs-sync/%s", WQ_FREEZABLE, 0, in xfs_init_mount_workqueues()
899 mp->m_fsname); in xfs_init_mount_workqueues()
900 if (!mp->m_sync_workqueue) in xfs_init_mount_workqueues()
906 destroy_workqueue(mp->m_eofblocks_workqueue); in xfs_init_mount_workqueues()
908 destroy_workqueue(mp->m_log_workqueue); in xfs_init_mount_workqueues()
910 destroy_workqueue(mp->m_reclaim_workqueue); in xfs_init_mount_workqueues()
912 destroy_workqueue(mp->m_cil_workqueue); in xfs_init_mount_workqueues()
914 destroy_workqueue(mp->m_unwritten_workqueue); in xfs_init_mount_workqueues()
916 destroy_workqueue(mp->m_data_workqueue); in xfs_init_mount_workqueues()
918 destroy_workqueue(mp->m_buf_workqueue); in xfs_init_mount_workqueues()
925 struct xfs_mount *mp) in xfs_destroy_mount_workqueues() argument
927 destroy_workqueue(mp->m_sync_workqueue); in xfs_destroy_mount_workqueues()
928 destroy_workqueue(mp->m_eofblocks_workqueue); in xfs_destroy_mount_workqueues()
929 destroy_workqueue(mp->m_log_workqueue); in xfs_destroy_mount_workqueues()
930 destroy_workqueue(mp->m_reclaim_workqueue); in xfs_destroy_mount_workqueues()
931 destroy_workqueue(mp->m_cil_workqueue); in xfs_destroy_mount_workqueues()
932 destroy_workqueue(mp->m_data_workqueue); in xfs_destroy_mount_workqueues()
933 destroy_workqueue(mp->m_unwritten_workqueue); in xfs_destroy_mount_workqueues()
934 destroy_workqueue(mp->m_buf_workqueue); in xfs_destroy_mount_workqueues()
945 struct xfs_mount *mp) in xfs_flush_inodes() argument
947 struct super_block *sb = mp->m_super; in xfs_flush_inodes()
1067 struct xfs_mount *mp) in xfs_free_fsname() argument
1069 kfree(mp->m_fsname); in xfs_free_fsname()
1070 kfree(mp->m_rtname); in xfs_free_fsname()
1071 kfree(mp->m_logname); in xfs_free_fsname()
1079 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_sync_fs() local
1087 xfs_log_force(mp, XFS_LOG_SYNC); in xfs_fs_sync_fs()
1094 flush_delayed_work(&mp->m_log->l_work); in xfs_fs_sync_fs()
1105 struct xfs_mount *mp = XFS_M(dentry->d_sb); in xfs_fs_statfs() local
1106 xfs_sb_t *sbp = &mp->m_sb; in xfs_fs_statfs()
1118 id = huge_encode_dev(mp->m_ddev_targp->bt_dev); in xfs_fs_statfs()
1122 icount = percpu_counter_sum(&mp->m_icount); in xfs_fs_statfs()
1123 ifree = percpu_counter_sum(&mp->m_ifree); in xfs_fs_statfs()
1124 fdblocks = percpu_counter_sum(&mp->m_fdblocks); in xfs_fs_statfs()
1126 spin_lock(&mp->m_sb_lock); in xfs_fs_statfs()
1130 spin_unlock(&mp->m_sb_lock); in xfs_fs_statfs()
1132 statp->f_bfree = fdblocks - mp->m_alloc_set_aside; in xfs_fs_statfs()
1137 if (mp->m_maxicount) in xfs_fs_statfs()
1140 mp->m_maxicount); in xfs_fs_statfs()
1153 ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD))) == in xfs_fs_statfs()
1160 xfs_save_resvblks(struct xfs_mount *mp) in xfs_save_resvblks() argument
1164 mp->m_resblks_save = mp->m_resblks; in xfs_save_resvblks()
1165 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_save_resvblks()
1169 xfs_restore_resvblks(struct xfs_mount *mp) in xfs_restore_resvblks() argument
1173 if (mp->m_resblks_save) { in xfs_restore_resvblks()
1174 resblks = mp->m_resblks_save; in xfs_restore_resvblks()
1175 mp->m_resblks_save = 0; in xfs_restore_resvblks()
1177 resblks = xfs_default_resblks(mp); in xfs_restore_resvblks()
1179 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_restore_resvblks()
1195 struct xfs_mount *mp) in xfs_quiesce_attr() argument
1200 while (atomic_read(&mp->m_active_trans) > 0) in xfs_quiesce_attr()
1204 xfs_log_force(mp, XFS_LOG_SYNC); in xfs_quiesce_attr()
1207 xfs_reclaim_inodes(mp, 0); in xfs_quiesce_attr()
1208 xfs_reclaim_inodes(mp, SYNC_WAIT); in xfs_quiesce_attr()
1211 error = xfs_log_sbcount(mp); in xfs_quiesce_attr()
1213 xfs_warn(mp, "xfs_attr_quiesce: failed to log sb changes. " in xfs_quiesce_attr()
1219 WARN_ON(atomic_read(&mp->m_active_trans) != 0); in xfs_quiesce_attr()
1221 xfs_log_quiesce(mp); in xfs_quiesce_attr()
1227 struct xfs_mount *mp, in xfs_test_remount_options() argument
1251 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_remount() local
1252 xfs_sb_t *sbp = &mp->m_sb; in xfs_fs_remount()
1258 error = xfs_test_remount_options(sb, mp, options); in xfs_fs_remount()
1272 xfs_warn(mp, "%s option is deprecated, ignoring.", p); in xfs_fs_remount()
1273 mp->m_flags |= XFS_MOUNT_BARRIER; in xfs_fs_remount()
1276 xfs_warn(mp, "%s option is deprecated, ignoring.", p); in xfs_fs_remount()
1277 mp->m_flags &= ~XFS_MOUNT_BARRIER; in xfs_fs_remount()
1280 mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; in xfs_fs_remount()
1281 mp->m_maxagi = xfs_set_inode_alloc(mp, sbp->sb_agcount); in xfs_fs_remount()
1284 mp->m_flags |= XFS_MOUNT_SMALL_INUMS; in xfs_fs_remount()
1285 mp->m_maxagi = xfs_set_inode_alloc(mp, sbp->sb_agcount); in xfs_fs_remount()
1305 xfs_info(mp, in xfs_fs_remount()
1315 if ((mp->m_flags & XFS_MOUNT_RDONLY) && !(*flags & MS_RDONLY)) { in xfs_fs_remount()
1316 if (mp->m_flags & XFS_MOUNT_NORECOVERY) { in xfs_fs_remount()
1317 xfs_warn(mp, in xfs_fs_remount()
1325 xfs_warn(mp, in xfs_fs_remount()
1332 mp->m_flags &= ~XFS_MOUNT_RDONLY; in xfs_fs_remount()
1338 if (mp->m_update_sb) { in xfs_fs_remount()
1339 error = xfs_sync_sb(mp, false); in xfs_fs_remount()
1341 xfs_warn(mp, "failed to write sb changes"); in xfs_fs_remount()
1344 mp->m_update_sb = false; in xfs_fs_remount()
1351 xfs_restore_resvblks(mp); in xfs_fs_remount()
1352 xfs_log_work_queue(mp); in xfs_fs_remount()
1353 xfs_queue_eofblocks(mp); in xfs_fs_remount()
1356 error = xfs_reflink_recover_cow(mp); in xfs_fs_remount()
1358 xfs_err(mp, in xfs_fs_remount()
1360 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_fs_remount()
1365 error = xfs_fs_reserve_ag_blocks(mp); in xfs_fs_remount()
1371 if (!(mp->m_flags & XFS_MOUNT_RDONLY) && (*flags & MS_RDONLY)) { in xfs_fs_remount()
1373 error = xfs_fs_unreserve_ag_blocks(mp); in xfs_fs_remount()
1375 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_fs_remount()
1386 xfs_save_resvblks(mp); in xfs_fs_remount()
1392 cancel_delayed_work_sync(&mp->m_eofblocks_work); in xfs_fs_remount()
1394 xfs_quiesce_attr(mp); in xfs_fs_remount()
1395 mp->m_flags |= XFS_MOUNT_RDONLY; in xfs_fs_remount()
1411 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_freeze() local
1413 xfs_save_resvblks(mp); in xfs_fs_freeze()
1414 xfs_quiesce_attr(mp); in xfs_fs_freeze()
1415 return xfs_sync_sb(mp, true); in xfs_fs_freeze()
1422 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_unfreeze() local
1424 xfs_restore_resvblks(mp); in xfs_fs_unfreeze()
1425 xfs_log_work_queue(mp); in xfs_fs_unfreeze()
1443 struct xfs_mount *mp) in xfs_finish_flags() argument
1445 int ronly = (mp->m_flags & XFS_MOUNT_RDONLY); in xfs_finish_flags()
1448 if (xfs_sb_version_haslogv2(&mp->m_sb)) { in xfs_finish_flags()
1449 if (mp->m_logbsize <= 0 && in xfs_finish_flags()
1450 mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
1451 mp->m_logbsize = mp->m_sb.sb_logsunit; in xfs_finish_flags()
1452 } else if (mp->m_logbsize > 0 && in xfs_finish_flags()
1453 mp->m_logbsize < mp->m_sb.sb_logsunit) { in xfs_finish_flags()
1454 xfs_warn(mp, in xfs_finish_flags()
1460 if (mp->m_logbsize > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
1461 xfs_warn(mp, in xfs_finish_flags()
1470 if (xfs_sb_version_hascrc(&mp->m_sb) && in xfs_finish_flags()
1471 (mp->m_flags & XFS_MOUNT_NOATTR2)) { in xfs_finish_flags()
1472 xfs_warn(mp, "Cannot mount a V5 filesystem as noattr2. " in xfs_finish_flags()
1481 if (xfs_sb_version_hasattr2(&mp->m_sb) && in xfs_finish_flags()
1482 !(mp->m_flags & XFS_MOUNT_NOATTR2)) in xfs_finish_flags()
1483 mp->m_flags |= XFS_MOUNT_ATTR2; in xfs_finish_flags()
1488 if ((mp->m_sb.sb_flags & XFS_SBF_READONLY) && !ronly) { in xfs_finish_flags()
1489 xfs_warn(mp, in xfs_finish_flags()
1494 if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) && in xfs_finish_flags()
1495 (mp->m_qflags & (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE)) && in xfs_finish_flags()
1496 !xfs_sb_version_has_pquotino(&mp->m_sb)) { in xfs_finish_flags()
1497 xfs_warn(mp, in xfs_finish_flags()
1507 struct xfs_mount *mp) in xfs_init_percpu_counters() argument
1511 error = percpu_counter_init(&mp->m_icount, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1515 error = percpu_counter_init(&mp->m_ifree, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1519 error = percpu_counter_init(&mp->m_fdblocks, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1526 percpu_counter_destroy(&mp->m_ifree); in xfs_init_percpu_counters()
1528 percpu_counter_destroy(&mp->m_icount); in xfs_init_percpu_counters()
1534 struct xfs_mount *mp) in xfs_reinit_percpu_counters() argument
1536 percpu_counter_set(&mp->m_icount, mp->m_sb.sb_icount); in xfs_reinit_percpu_counters()
1537 percpu_counter_set(&mp->m_ifree, mp->m_sb.sb_ifree); in xfs_reinit_percpu_counters()
1538 percpu_counter_set(&mp->m_fdblocks, mp->m_sb.sb_fdblocks); in xfs_reinit_percpu_counters()
1543 struct xfs_mount *mp) in xfs_destroy_percpu_counters() argument
1545 percpu_counter_destroy(&mp->m_icount); in xfs_destroy_percpu_counters()
1546 percpu_counter_destroy(&mp->m_ifree); in xfs_destroy_percpu_counters()
1547 percpu_counter_destroy(&mp->m_fdblocks); in xfs_destroy_percpu_counters()
1557 struct xfs_mount *mp = NULL; in xfs_fs_fill_super() local
1560 mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL); in xfs_fs_fill_super()
1561 if (!mp) in xfs_fs_fill_super()
1564 spin_lock_init(&mp->m_sb_lock); in xfs_fs_fill_super()
1565 mutex_init(&mp->m_growlock); in xfs_fs_fill_super()
1566 atomic_set(&mp->m_active_trans, 0); in xfs_fs_fill_super()
1567 INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker); in xfs_fs_fill_super()
1568 INIT_DELAYED_WORK(&mp->m_eofblocks_work, xfs_eofblocks_worker); in xfs_fs_fill_super()
1569 INIT_DELAYED_WORK(&mp->m_cowblocks_work, xfs_cowblocks_worker); in xfs_fs_fill_super()
1570 mp->m_kobj.kobject.kset = xfs_kset; in xfs_fs_fill_super()
1572 mp->m_super = sb; in xfs_fs_fill_super()
1573 sb->s_fs_info = mp; in xfs_fs_fill_super()
1575 error = xfs_parseargs(mp, (char *)data); in xfs_fs_fill_super()
1591 error = xfs_open_devices(mp); in xfs_fs_fill_super()
1595 error = xfs_init_mount_workqueues(mp); in xfs_fs_fill_super()
1599 error = xfs_init_percpu_counters(mp); in xfs_fs_fill_super()
1604 mp->m_stats.xs_stats = alloc_percpu(struct xfsstats); in xfs_fs_fill_super()
1605 if (!mp->m_stats.xs_stats) { in xfs_fs_fill_super()
1610 error = xfs_readsb(mp, flags); in xfs_fs_fill_super()
1614 error = xfs_finish_flags(mp); in xfs_fs_fill_super()
1618 error = xfs_setup_devices(mp); in xfs_fs_fill_super()
1622 error = xfs_filestream_mount(mp); in xfs_fs_fill_super()
1631 sb->s_blocksize = mp->m_sb.sb_blocksize; in xfs_fs_fill_super()
1639 if (XFS_SB_VERSION_NUM(&mp->m_sb) == XFS_SB_VERSION_5) in xfs_fs_fill_super()
1642 if (mp->m_flags & XFS_MOUNT_DAX) { in xfs_fs_fill_super()
1645 xfs_warn(mp, in xfs_fs_fill_super()
1648 datadev_is_dax = bdev_dax_supported(mp->m_ddev_targp->bt_bdev, in xfs_fs_fill_super()
1650 if (mp->m_rtdev_targp) in xfs_fs_fill_super()
1652 mp->m_rtdev_targp->bt_bdev, sb->s_blocksize); in xfs_fs_fill_super()
1654 xfs_alert(mp, in xfs_fs_fill_super()
1656 mp->m_flags &= ~XFS_MOUNT_DAX; in xfs_fs_fill_super()
1658 if (xfs_sb_version_hasreflink(&mp->m_sb)) in xfs_fs_fill_super()
1659 xfs_alert(mp, in xfs_fs_fill_super()
1663 if (mp->m_flags & XFS_MOUNT_DISCARD) { in xfs_fs_fill_super()
1667 xfs_warn(mp, "mounting with \"discard\" option, but " in xfs_fs_fill_super()
1669 mp->m_flags &= ~XFS_MOUNT_DISCARD; in xfs_fs_fill_super()
1673 if (xfs_sb_version_hasrmapbt(&mp->m_sb)) { in xfs_fs_fill_super()
1674 if (mp->m_sb.sb_rblocks) { in xfs_fs_fill_super()
1675 xfs_alert(mp, in xfs_fs_fill_super()
1680 xfs_alert(mp, in xfs_fs_fill_super()
1684 if (xfs_sb_version_hasreflink(&mp->m_sb)) in xfs_fs_fill_super()
1685 xfs_alert(mp, in xfs_fs_fill_super()
1688 error = xfs_mountfs(mp); in xfs_fs_fill_super()
1692 root = igrab(VFS_I(mp->m_rootip)); in xfs_fs_fill_super()
1706 xfs_filestream_unmount(mp); in xfs_fs_fill_super()
1708 xfs_freesb(mp); in xfs_fs_fill_super()
1710 free_percpu(mp->m_stats.xs_stats); in xfs_fs_fill_super()
1712 xfs_destroy_percpu_counters(mp); in xfs_fs_fill_super()
1714 xfs_destroy_mount_workqueues(mp); in xfs_fs_fill_super()
1716 xfs_close_devices(mp); in xfs_fs_fill_super()
1719 xfs_free_fsname(mp); in xfs_fs_fill_super()
1720 kfree(mp); in xfs_fs_fill_super()
1725 xfs_filestream_unmount(mp); in xfs_fs_fill_super()
1726 xfs_unmountfs(mp); in xfs_fs_fill_super()
1734 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_put_super() local
1740 xfs_notice(mp, "Unmounting Filesystem"); in xfs_fs_put_super()
1741 xfs_filestream_unmount(mp); in xfs_fs_put_super()
1742 xfs_unmountfs(mp); in xfs_fs_put_super()
1744 xfs_freesb(mp); in xfs_fs_put_super()
1745 free_percpu(mp->m_stats.xs_stats); in xfs_fs_put_super()
1746 xfs_destroy_percpu_counters(mp); in xfs_fs_put_super()
1747 xfs_destroy_mount_workqueues(mp); in xfs_fs_put_super()
1748 xfs_close_devices(mp); in xfs_fs_put_super()
1751 xfs_free_fsname(mp); in xfs_fs_put_super()
1752 kfree(mp); in xfs_fs_put_super()