Lines Matching refs:mp
173 struct xfs_mount *mp, in xfs_parseargs() argument
176 struct super_block *sb = mp->m_super; in xfs_parseargs()
187 mp->m_fsname = kstrndup(sb->s_id, MAXNAMELEN, GFP_KERNEL); in xfs_parseargs()
188 if (!mp->m_fsname) in xfs_parseargs()
190 mp->m_fsname_len = strlen(mp->m_fsname) + 1; in xfs_parseargs()
196 mp->m_flags |= XFS_MOUNT_RDONLY; in xfs_parseargs()
198 mp->m_flags |= XFS_MOUNT_DIRSYNC; in xfs_parseargs()
200 mp->m_flags |= XFS_MOUNT_WSYNC; in xfs_parseargs()
206 mp->m_flags |= XFS_MOUNT_BARRIER; in xfs_parseargs()
207 mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; in xfs_parseargs()
212 mp->m_logbufs = -1; in xfs_parseargs()
213 mp->m_logbsize = -1; in xfs_parseargs()
226 xfs_warn(mp, "%s option requires an argument", in xfs_parseargs()
230 if (kstrtoint(value, 10, &mp->m_logbufs)) in xfs_parseargs()
234 xfs_warn(mp, "%s option requires an argument", in xfs_parseargs()
238 if (suffix_kstrtoint(value, 10, &mp->m_logbsize)) in xfs_parseargs()
242 xfs_warn(mp, "%s option requires an argument", in xfs_parseargs()
246 mp->m_logname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); in xfs_parseargs()
247 if (!mp->m_logname) in xfs_parseargs()
250 xfs_warn(mp, "%s option not allowed on this system", in xfs_parseargs()
255 xfs_warn(mp, "%s option requires an argument", in xfs_parseargs()
259 mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); in xfs_parseargs()
260 if (!mp->m_rtname) in xfs_parseargs()
264 xfs_warn(mp, "%s option requires an argument", in xfs_parseargs()
273 xfs_warn(mp, "%s option requires an argument", in xfs_parseargs()
282 mp->m_flags |= XFS_MOUNT_GRPID; in xfs_parseargs()
285 mp->m_flags &= ~XFS_MOUNT_GRPID; in xfs_parseargs()
287 mp->m_flags |= XFS_MOUNT_WSYNC; in xfs_parseargs()
289 mp->m_flags |= XFS_MOUNT_NORECOVERY; in xfs_parseargs()
291 mp->m_flags |= XFS_MOUNT_NOALIGN; in xfs_parseargs()
293 mp->m_flags |= XFS_MOUNT_SWALLOC; in xfs_parseargs()
296 xfs_warn(mp, "%s option requires an argument", in xfs_parseargs()
304 xfs_warn(mp, "%s option requires an argument", in xfs_parseargs()
311 mp->m_flags |= XFS_MOUNT_SMALL_INUMS; in xfs_parseargs()
313 mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; in xfs_parseargs()
315 mp->m_flags |= XFS_MOUNT_NOUUID; in xfs_parseargs()
317 mp->m_flags |= XFS_MOUNT_BARRIER; in xfs_parseargs()
319 mp->m_flags &= ~XFS_MOUNT_BARRIER; in xfs_parseargs()
321 mp->m_flags |= XFS_MOUNT_IKEEP; in xfs_parseargs()
323 mp->m_flags &= ~XFS_MOUNT_IKEEP; in xfs_parseargs()
325 mp->m_flags &= ~XFS_MOUNT_COMPAT_IOSIZE; in xfs_parseargs()
327 mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; in xfs_parseargs()
329 mp->m_flags |= XFS_MOUNT_ATTR2; in xfs_parseargs()
331 mp->m_flags &= ~XFS_MOUNT_ATTR2; in xfs_parseargs()
332 mp->m_flags |= XFS_MOUNT_NOATTR2; in xfs_parseargs()
334 mp->m_flags |= XFS_MOUNT_FILESTREAMS; in xfs_parseargs()
336 mp->m_qflags &= ~XFS_ALL_QUOTA_ACCT; in xfs_parseargs()
337 mp->m_qflags &= ~XFS_ALL_QUOTA_ENFD; in xfs_parseargs()
338 mp->m_qflags &= ~XFS_ALL_QUOTA_ACTIVE; in xfs_parseargs()
342 mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | in xfs_parseargs()
346 mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE); in xfs_parseargs()
347 mp->m_qflags &= ~XFS_UQUOTA_ENFD; in xfs_parseargs()
350 mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | in xfs_parseargs()
353 mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); in xfs_parseargs()
354 mp->m_qflags &= ~XFS_PQUOTA_ENFD; in xfs_parseargs()
357 mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | in xfs_parseargs()
360 mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); in xfs_parseargs()
361 mp->m_qflags &= ~XFS_GQUOTA_ENFD; in xfs_parseargs()
363 mp->m_flags |= XFS_MOUNT_DISCARD; in xfs_parseargs()
365 mp->m_flags &= ~XFS_MOUNT_DISCARD; in xfs_parseargs()
367 xfs_warn(mp, "unknown mount option [%s].", this_char); in xfs_parseargs()
375 if ((mp->m_flags & XFS_MOUNT_NORECOVERY) && in xfs_parseargs()
376 !(mp->m_flags & XFS_MOUNT_RDONLY)) { in xfs_parseargs()
377 xfs_warn(mp, "no-recovery mounts must be read-only."); in xfs_parseargs()
381 if ((mp->m_flags & XFS_MOUNT_NOALIGN) && (dsunit || dswidth)) { in xfs_parseargs()
382 xfs_warn(mp, in xfs_parseargs()
388 if (XFS_IS_QUOTA_RUNNING(mp)) { in xfs_parseargs()
389 xfs_warn(mp, "quota support not available in this kernel."); in xfs_parseargs()
395 xfs_warn(mp, "sunit and swidth must be specified together"); in xfs_parseargs()
400 xfs_warn(mp, in xfs_parseargs()
407 if (dsunit && !(mp->m_flags & XFS_MOUNT_NOALIGN)) { in xfs_parseargs()
414 mp->m_dalign = dsunit; in xfs_parseargs()
415 mp->m_swidth = dswidth; in xfs_parseargs()
418 if (mp->m_logbufs != -1 && in xfs_parseargs()
419 mp->m_logbufs != 0 && in xfs_parseargs()
420 (mp->m_logbufs < XLOG_MIN_ICLOGS || in xfs_parseargs()
421 mp->m_logbufs > XLOG_MAX_ICLOGS)) { in xfs_parseargs()
422 xfs_warn(mp, "invalid logbufs value: %d [not %d-%d]", in xfs_parseargs()
423 mp->m_logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS); in xfs_parseargs()
426 if (mp->m_logbsize != -1 && in xfs_parseargs()
427 mp->m_logbsize != 0 && in xfs_parseargs()
428 (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE || in xfs_parseargs()
429 mp->m_logbsize > XLOG_MAX_RECORD_BSIZE || in xfs_parseargs()
430 !is_power_of_2(mp->m_logbsize))) { in xfs_parseargs()
431 xfs_warn(mp, in xfs_parseargs()
433 mp->m_logbsize); in xfs_parseargs()
440 xfs_warn(mp, "invalid log iosize: %d [not %d-%d]", in xfs_parseargs()
446 mp->m_flags |= XFS_MOUNT_DFLT_IOSIZE; in xfs_parseargs()
447 mp->m_readio_log = iosizelog; in xfs_parseargs()
448 mp->m_writeio_log = iosizelog; in xfs_parseargs()
461 struct xfs_mount *mp, in xfs_showargs() argument
489 if (mp->m_flags & xfs_infop->flag) in xfs_showargs()
493 if (!(mp->m_flags & xfs_infop->flag)) in xfs_showargs()
497 if (mp->m_flags & XFS_MOUNT_DFLT_IOSIZE) in xfs_showargs()
499 (int)(1 << mp->m_writeio_log) >> 10); in xfs_showargs()
501 if (mp->m_logbufs > 0) in xfs_showargs()
502 seq_printf(m, "," MNTOPT_LOGBUFS "=%d", mp->m_logbufs); in xfs_showargs()
503 if (mp->m_logbsize > 0) in xfs_showargs()
504 seq_printf(m, "," MNTOPT_LOGBSIZE "=%dk", mp->m_logbsize >> 10); in xfs_showargs()
506 if (mp->m_logname) in xfs_showargs()
507 seq_show_option(m, MNTOPT_LOGDEV, mp->m_logname); in xfs_showargs()
508 if (mp->m_rtname) in xfs_showargs()
509 seq_show_option(m, MNTOPT_RTDEV, mp->m_rtname); in xfs_showargs()
511 if (mp->m_dalign > 0) in xfs_showargs()
513 (int)XFS_FSB_TO_BB(mp, mp->m_dalign)); in xfs_showargs()
514 if (mp->m_swidth > 0) in xfs_showargs()
516 (int)XFS_FSB_TO_BB(mp, mp->m_swidth)); in xfs_showargs()
518 if (mp->m_qflags & (XFS_UQUOTA_ACCT|XFS_UQUOTA_ENFD)) in xfs_showargs()
520 else if (mp->m_qflags & XFS_UQUOTA_ACCT) in xfs_showargs()
523 if (mp->m_qflags & XFS_PQUOTA_ACCT) { in xfs_showargs()
524 if (mp->m_qflags & XFS_PQUOTA_ENFD) in xfs_showargs()
529 if (mp->m_qflags & XFS_GQUOTA_ACCT) { in xfs_showargs()
530 if (mp->m_qflags & XFS_GQUOTA_ENFD) in xfs_showargs()
536 if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) in xfs_showargs()
581 xfs_set_inode32(struct xfs_mount *mp, xfs_agnumber_t agcount) in xfs_set_inode32() argument
585 xfs_sb_t *sbp = &mp->m_sb; in xfs_set_inode32()
594 if (mp->m_maxicount) { in xfs_set_inode32()
606 agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks - 1, 0); in xfs_set_inode32()
609 ino = XFS_AGINO_TO_INO(mp, index, agino); in xfs_set_inode32()
612 pag = xfs_perag_get(mp, index); in xfs_set_inode32()
619 pag = xfs_perag_get(mp, index); in xfs_set_inode32()
626 mp->m_flags |= (XFS_MOUNT_32BITINODES | in xfs_set_inode32()
633 xfs_set_inode64(struct xfs_mount *mp, xfs_agnumber_t agcount) in xfs_set_inode64() argument
640 pag = xfs_perag_get(mp, index); in xfs_set_inode64()
651 mp->m_flags &= ~(XFS_MOUNT_32BITINODES | in xfs_set_inode64()
658 xfs_mount_t *mp, in xfs_blkdev_get() argument
665 mp); in xfs_blkdev_get()
668 xfs_warn(mp, "Invalid device [%s], error=%d", name, error); in xfs_blkdev_get()
691 struct xfs_mount *mp) in xfs_close_devices() argument
693 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { in xfs_close_devices()
694 struct block_device *logdev = mp->m_logdev_targp->bt_bdev; in xfs_close_devices()
695 xfs_free_buftarg(mp, mp->m_logdev_targp); in xfs_close_devices()
698 if (mp->m_rtdev_targp) { in xfs_close_devices()
699 struct block_device *rtdev = mp->m_rtdev_targp->bt_bdev; in xfs_close_devices()
700 xfs_free_buftarg(mp, mp->m_rtdev_targp); in xfs_close_devices()
703 xfs_free_buftarg(mp, mp->m_ddev_targp); in xfs_close_devices()
718 struct xfs_mount *mp) in xfs_open_devices() argument
720 struct block_device *ddev = mp->m_super->s_bdev; in xfs_open_devices()
727 if (mp->m_logname) { in xfs_open_devices()
728 error = xfs_blkdev_get(mp, mp->m_logname, &logdev); in xfs_open_devices()
733 if (mp->m_rtname) { in xfs_open_devices()
734 error = xfs_blkdev_get(mp, mp->m_rtname, &rtdev); in xfs_open_devices()
739 xfs_warn(mp, in xfs_open_devices()
750 mp->m_ddev_targp = xfs_alloc_buftarg(mp, ddev); in xfs_open_devices()
751 if (!mp->m_ddev_targp) in xfs_open_devices()
755 mp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev); in xfs_open_devices()
756 if (!mp->m_rtdev_targp) in xfs_open_devices()
761 mp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev); in xfs_open_devices()
762 if (!mp->m_logdev_targp) in xfs_open_devices()
765 mp->m_logdev_targp = mp->m_ddev_targp; in xfs_open_devices()
771 if (mp->m_rtdev_targp) in xfs_open_devices()
772 xfs_free_buftarg(mp, mp->m_rtdev_targp); in xfs_open_devices()
774 xfs_free_buftarg(mp, mp->m_ddev_targp); in xfs_open_devices()
789 struct xfs_mount *mp) in xfs_setup_devices() argument
793 error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_sectsize); in xfs_setup_devices()
797 if (mp->m_logdev_targp && mp->m_logdev_targp != mp->m_ddev_targp) { in xfs_setup_devices()
800 if (xfs_sb_version_hassector(&mp->m_sb)) in xfs_setup_devices()
801 log_sector_size = mp->m_sb.sb_logsectsize; in xfs_setup_devices()
802 error = xfs_setsize_buftarg(mp->m_logdev_targp, in xfs_setup_devices()
807 if (mp->m_rtdev_targp) { in xfs_setup_devices()
808 error = xfs_setsize_buftarg(mp->m_rtdev_targp, in xfs_setup_devices()
809 mp->m_sb.sb_sectsize); in xfs_setup_devices()
819 struct xfs_mount *mp) in xfs_init_mount_workqueues() argument
821 mp->m_buf_workqueue = alloc_workqueue("xfs-buf/%s", in xfs_init_mount_workqueues()
822 WQ_MEM_RECLAIM|WQ_FREEZABLE, 1, mp->m_fsname); in xfs_init_mount_workqueues()
823 if (!mp->m_buf_workqueue) in xfs_init_mount_workqueues()
826 mp->m_data_workqueue = alloc_workqueue("xfs-data/%s", in xfs_init_mount_workqueues()
827 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); in xfs_init_mount_workqueues()
828 if (!mp->m_data_workqueue) in xfs_init_mount_workqueues()
831 mp->m_unwritten_workqueue = alloc_workqueue("xfs-conv/%s", in xfs_init_mount_workqueues()
832 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); in xfs_init_mount_workqueues()
833 if (!mp->m_unwritten_workqueue) in xfs_init_mount_workqueues()
836 mp->m_cil_workqueue = alloc_workqueue("xfs-cil/%s", in xfs_init_mount_workqueues()
837 WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); in xfs_init_mount_workqueues()
838 if (!mp->m_cil_workqueue) in xfs_init_mount_workqueues()
841 mp->m_reclaim_workqueue = alloc_workqueue("xfs-reclaim/%s", in xfs_init_mount_workqueues()
842 WQ_FREEZABLE, 0, mp->m_fsname); in xfs_init_mount_workqueues()
843 if (!mp->m_reclaim_workqueue) in xfs_init_mount_workqueues()
846 mp->m_log_workqueue = alloc_workqueue("xfs-log/%s", in xfs_init_mount_workqueues()
847 WQ_FREEZABLE|WQ_HIGHPRI, 0, mp->m_fsname); in xfs_init_mount_workqueues()
848 if (!mp->m_log_workqueue) in xfs_init_mount_workqueues()
851 mp->m_eofblocks_workqueue = alloc_workqueue("xfs-eofblocks/%s", in xfs_init_mount_workqueues()
852 WQ_FREEZABLE, 0, mp->m_fsname); in xfs_init_mount_workqueues()
853 if (!mp->m_eofblocks_workqueue) in xfs_init_mount_workqueues()
859 destroy_workqueue(mp->m_log_workqueue); in xfs_init_mount_workqueues()
861 destroy_workqueue(mp->m_reclaim_workqueue); in xfs_init_mount_workqueues()
863 destroy_workqueue(mp->m_cil_workqueue); in xfs_init_mount_workqueues()
865 destroy_workqueue(mp->m_unwritten_workqueue); in xfs_init_mount_workqueues()
867 destroy_workqueue(mp->m_data_workqueue); in xfs_init_mount_workqueues()
869 destroy_workqueue(mp->m_buf_workqueue); in xfs_init_mount_workqueues()
876 struct xfs_mount *mp) in xfs_destroy_mount_workqueues() argument
878 destroy_workqueue(mp->m_eofblocks_workqueue); in xfs_destroy_mount_workqueues()
879 destroy_workqueue(mp->m_log_workqueue); in xfs_destroy_mount_workqueues()
880 destroy_workqueue(mp->m_reclaim_workqueue); in xfs_destroy_mount_workqueues()
881 destroy_workqueue(mp->m_cil_workqueue); in xfs_destroy_mount_workqueues()
882 destroy_workqueue(mp->m_data_workqueue); in xfs_destroy_mount_workqueues()
883 destroy_workqueue(mp->m_unwritten_workqueue); in xfs_destroy_mount_workqueues()
884 destroy_workqueue(mp->m_buf_workqueue); in xfs_destroy_mount_workqueues()
895 struct xfs_mount *mp) in xfs_flush_inodes() argument
897 struct super_block *sb = mp->m_super; in xfs_flush_inodes()
1011 struct xfs_mount *mp) in xfs_free_fsname() argument
1013 kfree(mp->m_fsname); in xfs_free_fsname()
1014 kfree(mp->m_rtname); in xfs_free_fsname()
1015 kfree(mp->m_logname); in xfs_free_fsname()
1023 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_sync_fs() local
1031 xfs_log_force(mp, XFS_LOG_SYNC); in xfs_fs_sync_fs()
1038 flush_delayed_work(&mp->m_log->l_work); in xfs_fs_sync_fs()
1049 struct xfs_mount *mp = XFS_M(dentry->d_sb); in xfs_fs_statfs() local
1050 xfs_sb_t *sbp = &mp->m_sb; in xfs_fs_statfs()
1062 id = huge_encode_dev(mp->m_ddev_targp->bt_dev); in xfs_fs_statfs()
1066 icount = percpu_counter_sum(&mp->m_icount); in xfs_fs_statfs()
1067 ifree = percpu_counter_sum(&mp->m_ifree); in xfs_fs_statfs()
1068 fdblocks = percpu_counter_sum(&mp->m_fdblocks); in xfs_fs_statfs()
1070 spin_lock(&mp->m_sb_lock); in xfs_fs_statfs()
1074 spin_unlock(&mp->m_sb_lock); in xfs_fs_statfs()
1076 statp->f_bfree = fdblocks - XFS_ALLOC_SET_ASIDE(mp); in xfs_fs_statfs()
1081 if (mp->m_maxicount) in xfs_fs_statfs()
1084 mp->m_maxicount); in xfs_fs_statfs()
1097 ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_PQUOTA_ENFD))) == in xfs_fs_statfs()
1104 xfs_save_resvblks(struct xfs_mount *mp) in xfs_save_resvblks() argument
1108 mp->m_resblks_save = mp->m_resblks; in xfs_save_resvblks()
1109 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_save_resvblks()
1113 xfs_restore_resvblks(struct xfs_mount *mp) in xfs_restore_resvblks() argument
1117 if (mp->m_resblks_save) { in xfs_restore_resvblks()
1118 resblks = mp->m_resblks_save; in xfs_restore_resvblks()
1119 mp->m_resblks_save = 0; in xfs_restore_resvblks()
1121 resblks = xfs_default_resblks(mp); in xfs_restore_resvblks()
1123 xfs_reserve_blocks(mp, &resblks, NULL); in xfs_restore_resvblks()
1139 struct xfs_mount *mp) in xfs_quiesce_attr() argument
1144 while (atomic_read(&mp->m_active_trans) > 0) in xfs_quiesce_attr()
1148 xfs_log_force(mp, XFS_LOG_SYNC); in xfs_quiesce_attr()
1151 xfs_reclaim_inodes(mp, 0); in xfs_quiesce_attr()
1152 xfs_reclaim_inodes(mp, SYNC_WAIT); in xfs_quiesce_attr()
1155 error = xfs_log_sbcount(mp); in xfs_quiesce_attr()
1157 xfs_warn(mp, "xfs_attr_quiesce: failed to log sb changes. " in xfs_quiesce_attr()
1163 WARN_ON(atomic_read(&mp->m_active_trans) != 0); in xfs_quiesce_attr()
1165 xfs_log_quiesce(mp); in xfs_quiesce_attr()
1174 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_remount() local
1175 xfs_sb_t *sbp = &mp->m_sb; in xfs_fs_remount()
1190 mp->m_flags |= XFS_MOUNT_BARRIER; in xfs_fs_remount()
1193 mp->m_flags &= ~XFS_MOUNT_BARRIER; in xfs_fs_remount()
1196 mp->m_maxagi = xfs_set_inode64(mp, sbp->sb_agcount); in xfs_fs_remount()
1199 mp->m_maxagi = xfs_set_inode32(mp, sbp->sb_agcount); in xfs_fs_remount()
1219 xfs_info(mp, in xfs_fs_remount()
1229 if ((mp->m_flags & XFS_MOUNT_RDONLY) && !(*flags & MS_RDONLY)) { in xfs_fs_remount()
1230 if (mp->m_flags & XFS_MOUNT_NORECOVERY) { in xfs_fs_remount()
1231 xfs_warn(mp, in xfs_fs_remount()
1239 xfs_warn(mp, in xfs_fs_remount()
1246 mp->m_flags &= ~XFS_MOUNT_RDONLY; in xfs_fs_remount()
1252 if (mp->m_update_sb) { in xfs_fs_remount()
1253 error = xfs_sync_sb(mp, false); in xfs_fs_remount()
1255 xfs_warn(mp, "failed to write sb changes"); in xfs_fs_remount()
1258 mp->m_update_sb = false; in xfs_fs_remount()
1265 xfs_restore_resvblks(mp); in xfs_fs_remount()
1266 xfs_log_work_queue(mp); in xfs_fs_remount()
1270 if (!(mp->m_flags & XFS_MOUNT_RDONLY) && (*flags & MS_RDONLY)) { in xfs_fs_remount()
1278 xfs_save_resvblks(mp); in xfs_fs_remount()
1279 xfs_quiesce_attr(mp); in xfs_fs_remount()
1280 mp->m_flags |= XFS_MOUNT_RDONLY; in xfs_fs_remount()
1296 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_freeze() local
1298 xfs_save_resvblks(mp); in xfs_fs_freeze()
1299 xfs_quiesce_attr(mp); in xfs_fs_freeze()
1300 return xfs_sync_sb(mp, true); in xfs_fs_freeze()
1307 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_unfreeze() local
1309 xfs_restore_resvblks(mp); in xfs_fs_unfreeze()
1310 xfs_log_work_queue(mp); in xfs_fs_unfreeze()
1328 struct xfs_mount *mp) in xfs_finish_flags() argument
1330 int ronly = (mp->m_flags & XFS_MOUNT_RDONLY); in xfs_finish_flags()
1333 if (xfs_sb_version_haslogv2(&mp->m_sb)) { in xfs_finish_flags()
1334 if (mp->m_logbsize <= 0 && in xfs_finish_flags()
1335 mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
1336 mp->m_logbsize = mp->m_sb.sb_logsunit; in xfs_finish_flags()
1337 } else if (mp->m_logbsize > 0 && in xfs_finish_flags()
1338 mp->m_logbsize < mp->m_sb.sb_logsunit) { in xfs_finish_flags()
1339 xfs_warn(mp, in xfs_finish_flags()
1345 if (mp->m_logbsize > XLOG_BIG_RECORD_BSIZE) { in xfs_finish_flags()
1346 xfs_warn(mp, in xfs_finish_flags()
1355 if (xfs_sb_version_hascrc(&mp->m_sb) && in xfs_finish_flags()
1356 (mp->m_flags & XFS_MOUNT_NOATTR2)) { in xfs_finish_flags()
1357 xfs_warn(mp, in xfs_finish_flags()
1367 if (xfs_sb_version_hasattr2(&mp->m_sb) && in xfs_finish_flags()
1368 !(mp->m_flags & XFS_MOUNT_NOATTR2)) in xfs_finish_flags()
1369 mp->m_flags |= XFS_MOUNT_ATTR2; in xfs_finish_flags()
1374 if ((mp->m_sb.sb_flags & XFS_SBF_READONLY) && !ronly) { in xfs_finish_flags()
1375 xfs_warn(mp, in xfs_finish_flags()
1380 if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) && in xfs_finish_flags()
1381 (mp->m_qflags & (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE)) && in xfs_finish_flags()
1382 !xfs_sb_version_has_pquotino(&mp->m_sb)) { in xfs_finish_flags()
1383 xfs_warn(mp, in xfs_finish_flags()
1393 struct xfs_mount *mp) in xfs_init_percpu_counters() argument
1397 error = percpu_counter_init(&mp->m_icount, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1401 error = percpu_counter_init(&mp->m_ifree, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1405 error = percpu_counter_init(&mp->m_fdblocks, 0, GFP_KERNEL); in xfs_init_percpu_counters()
1412 percpu_counter_destroy(&mp->m_ifree); in xfs_init_percpu_counters()
1414 percpu_counter_destroy(&mp->m_icount); in xfs_init_percpu_counters()
1420 struct xfs_mount *mp) in xfs_reinit_percpu_counters() argument
1422 percpu_counter_set(&mp->m_icount, mp->m_sb.sb_icount); in xfs_reinit_percpu_counters()
1423 percpu_counter_set(&mp->m_ifree, mp->m_sb.sb_ifree); in xfs_reinit_percpu_counters()
1424 percpu_counter_set(&mp->m_fdblocks, mp->m_sb.sb_fdblocks); in xfs_reinit_percpu_counters()
1429 struct xfs_mount *mp) in xfs_destroy_percpu_counters() argument
1431 percpu_counter_destroy(&mp->m_icount); in xfs_destroy_percpu_counters()
1432 percpu_counter_destroy(&mp->m_ifree); in xfs_destroy_percpu_counters()
1433 percpu_counter_destroy(&mp->m_fdblocks); in xfs_destroy_percpu_counters()
1443 struct xfs_mount *mp = NULL; in xfs_fs_fill_super() local
1446 mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL); in xfs_fs_fill_super()
1447 if (!mp) in xfs_fs_fill_super()
1450 spin_lock_init(&mp->m_sb_lock); in xfs_fs_fill_super()
1451 mutex_init(&mp->m_growlock); in xfs_fs_fill_super()
1452 atomic_set(&mp->m_active_trans, 0); in xfs_fs_fill_super()
1453 INIT_DELAYED_WORK(&mp->m_reclaim_work, xfs_reclaim_worker); in xfs_fs_fill_super()
1454 INIT_DELAYED_WORK(&mp->m_eofblocks_work, xfs_eofblocks_worker); in xfs_fs_fill_super()
1455 mp->m_kobj.kobject.kset = xfs_kset; in xfs_fs_fill_super()
1457 mp->m_super = sb; in xfs_fs_fill_super()
1458 sb->s_fs_info = mp; in xfs_fs_fill_super()
1460 error = xfs_parseargs(mp, (char *)data); in xfs_fs_fill_super()
1476 error = xfs_open_devices(mp); in xfs_fs_fill_super()
1480 error = xfs_init_mount_workqueues(mp); in xfs_fs_fill_super()
1484 error = xfs_init_percpu_counters(mp); in xfs_fs_fill_super()
1488 error = xfs_readsb(mp, flags); in xfs_fs_fill_super()
1492 error = xfs_finish_flags(mp); in xfs_fs_fill_super()
1496 error = xfs_setup_devices(mp); in xfs_fs_fill_super()
1500 error = xfs_filestream_mount(mp); in xfs_fs_fill_super()
1509 sb->s_blocksize = mp->m_sb.sb_blocksize; in xfs_fs_fill_super()
1517 if (XFS_SB_VERSION_NUM(&mp->m_sb) == XFS_SB_VERSION_5) in xfs_fs_fill_super()
1520 error = xfs_mountfs(mp); in xfs_fs_fill_super()
1524 root = igrab(VFS_I(mp->m_rootip)); in xfs_fs_fill_super()
1538 xfs_filestream_unmount(mp); in xfs_fs_fill_super()
1540 xfs_freesb(mp); in xfs_fs_fill_super()
1542 xfs_destroy_percpu_counters(mp); in xfs_fs_fill_super()
1544 xfs_destroy_mount_workqueues(mp); in xfs_fs_fill_super()
1546 xfs_close_devices(mp); in xfs_fs_fill_super()
1548 xfs_free_fsname(mp); in xfs_fs_fill_super()
1549 kfree(mp); in xfs_fs_fill_super()
1554 xfs_filestream_unmount(mp); in xfs_fs_fill_super()
1555 xfs_unmountfs(mp); in xfs_fs_fill_super()
1563 struct xfs_mount *mp = XFS_M(sb); in xfs_fs_put_super() local
1565 xfs_notice(mp, "Unmounting Filesystem"); in xfs_fs_put_super()
1566 xfs_filestream_unmount(mp); in xfs_fs_put_super()
1567 xfs_unmountfs(mp); in xfs_fs_put_super()
1569 xfs_freesb(mp); in xfs_fs_put_super()
1570 xfs_destroy_percpu_counters(mp); in xfs_fs_put_super()
1571 xfs_destroy_mount_workqueues(mp); in xfs_fs_put_super()
1572 xfs_close_devices(mp); in xfs_fs_put_super()
1573 xfs_free_fsname(mp); in xfs_fs_put_super()
1574 kfree(mp); in xfs_fs_put_super()