ffs_vfsops.c (c94cd5fc8c665816a6fee17bb97babdf01286f8d) ffs_vfsops.c (f257b7a54b4fe77840cf694314bdc401e00c31a1)
1/*
2 * Copyright (c) 1989, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 989 unchanged lines hidden (view full) ---

998{
999 struct ufsmount *ump;
1000 int error;
1001
1002 ump = VFSTOUFS(mp);
1003#ifdef QUOTA
1004 if (mp->mnt_flag & MNT_QUOTA) {
1005 int i;
1/*
2 * Copyright (c) 1989, 1991, 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 989 unchanged lines hidden (view full) ---

998{
999 struct ufsmount *ump;
1000 int error;
1001
1002 ump = VFSTOUFS(mp);
1003#ifdef QUOTA
1004 if (mp->mnt_flag & MNT_QUOTA) {
1005 int i;
1006 error = vflush(mp, 0, SKIPSYSTEM|flags);
1006 error = vflush(mp, 0, SKIPSYSTEM|flags, td);
1007 if (error)
1008 return (error);
1009 for (i = 0; i < MAXQUOTAS; i++) {
1010 if (ump->um_quotas[i] == NULLVP)
1011 continue;
1012 quotaoff(td, mp, i);
1013 }
1014 /*
1015 * Here we fall through to vflush again to ensure
1016 * that we have gotten rid of all the system vnodes.
1017 */
1018 }
1019#endif
1020 ASSERT_VOP_LOCKED(ump->um_devvp, "ffs_flushfiles");
1021 if (ump->um_devvp->v_vflag & VV_COPYONWRITE) {
1007 if (error)
1008 return (error);
1009 for (i = 0; i < MAXQUOTAS; i++) {
1010 if (ump->um_quotas[i] == NULLVP)
1011 continue;
1012 quotaoff(td, mp, i);
1013 }
1014 /*
1015 * Here we fall through to vflush again to ensure
1016 * that we have gotten rid of all the system vnodes.
1017 */
1018 }
1019#endif
1020 ASSERT_VOP_LOCKED(ump->um_devvp, "ffs_flushfiles");
1021 if (ump->um_devvp->v_vflag & VV_COPYONWRITE) {
1022 if ((error = vflush(mp, 0, SKIPSYSTEM | flags)) != 0)
1022 if ((error = vflush(mp, 0, SKIPSYSTEM | flags, td)) != 0)
1023 return (error);
1024 ffs_snapshot_unmount(mp);
1025 /*
1026 * Here we fall through to vflush again to ensure
1027 * that we have gotten rid of all the system vnodes.
1028 */
1029 }
1030 /*
1031 * Flush all the files.
1032 */
1023 return (error);
1024 ffs_snapshot_unmount(mp);
1025 /*
1026 * Here we fall through to vflush again to ensure
1027 * that we have gotten rid of all the system vnodes.
1028 */
1029 }
1030 /*
1031 * Flush all the files.
1032 */
1033 if ((error = vflush(mp, 0, flags)) != 0)
1033 if ((error = vflush(mp, 0, flags, td)) != 0)
1034 return (error);
1035 /*
1036 * Flush filesystem metadata.
1037 */
1038 vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, td);
1039 error = VOP_FSYNC(ump->um_devvp, td->td_ucred, MNT_WAIT, td);
1040 VOP_UNLOCK(ump->um_devvp, 0, td);
1041 return (error);

--- 492 unchanged lines hidden ---
1034 return (error);
1035 /*
1036 * Flush filesystem metadata.
1037 */
1038 vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, td);
1039 error = VOP_FSYNC(ump->um_devvp, td->td_ucred, MNT_WAIT, td);
1040 VOP_UNLOCK(ump->um_devvp, 0, td);
1041 return (error);

--- 492 unchanged lines hidden ---